[Zope-Checkins] CVS: Zope3/lib/python/Zope/Server/VFS/tests - testPublisherFilesystem.py:1.1.4.3
Jim Fulton
jim@zope.com
Mon, 10 Jun 2002 15:34:29 -0400
Update of /cvs-repository/Zope3/lib/python/Zope/Server/VFS/tests
In directory cvs.zope.org:/tmp/cvs-serv5490/lib/python/Zope/Server/VFS/tests
Modified Files:
Tag: Zope-3x-branch
testPublisherFilesystem.py
Log Message:
Implemented
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/IContainerPythonification
Along the way:
- Converted most uses of has_key to use in.
- Fixed a bug in Interface names and namesAndDescriptions methods
that caused base class attributes to be missed.
=== Zope3/lib/python/Zope/Server/VFS/tests/testPublisherFilesystem.py 1.1.4.2 => 1.1.4.3 ===
def exists(self, name):
"""See IVFSDirectoryPublisher."""
- return self.items.has_key(name)
+ return name in self.items
def listdir(self, with_stats=0, pattern='*'):
"""See IVFSDirectoryPublisher."""
@@ -130,20 +130,20 @@
def rename(self, old, new):
"""See IVFSDirectoryPublisher."""
- if self.items.has_key(new):
+ if new in self.items:
raise OSError, 'Name conflict'
self.items[new] = self.items[old]
del self.items[old]
def writefile(self, name, mode, instream, start=0):
"""See IVFSDirectoryPublisher."""
- if not self.items.has_key(name):
+ if not (name in self.items):
self.items[name] = TestFile()
self.items[name].write(mode, instream, start)
def check_writable(self, name):
"""See IVFSDirectoryPublisher."""
- if self.items.has_key(name):
+ if name in self.items:
if not self.items[name].isfile():
raise IOError, 'Is not a file'