[Zope-CVS] CVS: Products/Ape/lib/apelib/tests -
serialtestbase.py:1.6 testimpl.py:1.3 testio.py:1.7
testparams.py:1.2 testscanner.py:1.6 testserialization.py:1.7
testsqlimpl.py:1.3 teststorage.py:1.9 testzodbtables.py:1.3
testzope2fs.py:1.9 testzope2sql.py:1.10 zope2testbase.py:1.12
Shane Hathaway
shane at zope.com
Sat Mar 20 01:34:55 EST 2004
Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv19743/lib/apelib/tests
Modified Files:
serialtestbase.py testimpl.py testio.py testparams.py
testscanner.py testserialization.py testsqlimpl.py
teststorage.py testzodbtables.py testzope2fs.py
testzope2sql.py zope2testbase.py
Log Message:
Converted method and function names to conform with PEP 8.
PEP 8 (or perhaps the next revision) recommends
lowercase_with_underscores over mixedCase. Since everything is being
renamed for this release anyway, why not throw in this too? :-)
Also got SQLMultiTableProperties back into shape.
=== Products/Ape/lib/apelib/tests/serialtestbase.py 1.5 => 1.6 ===
--- Products/Ape/lib/apelib/tests/serialtestbase.py:1.5 Thu Feb 19 01:44:05 2004
+++ Products/Ape/lib/apelib/tests/serialtestbase.py Sat Mar 20 01:34:24 2004
@@ -31,7 +31,7 @@
strdata = ""
-def addMapper(conf, klass, mapper_name):
+def add_mapper(conf, klass, mapper_name):
"""Adds a simple mapper to the configuration.
"""
serializer = serializers.CompositeSerializer(
@@ -52,12 +52,12 @@
oid_gen = oidgen.SerialOIDGenerator()
self.conf = mapper.MapperConfiguration({}, cfr, oid_gen)
- m = addMapper(self.conf, PersistentMapping, "pm")
+ m = add_mapper(self.conf, PersistentMapping, "pm")
m.serializer.add("items", PersistentMappingSerializer())
m.serializer.add("rollcall", RollCall())
m.gateway.schema = m.serializer.schema
- m = addMapper(self.conf, TestObject, "tm")
+ m = add_mapper(self.conf, TestObject, "tm")
m.serializer.add("items", PersistentMappingSerializer())
m.serializer.add("remainder", RemainingState())
m.gateway.schema = m.serializer.schema
=== Products/Ape/lib/apelib/tests/testimpl.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/tests/testimpl.py:1.2 Wed Jul 30 17:33:08 2003
+++ Products/Ape/lib/apelib/tests/testimpl.py Sat Mar 20 01:34:24 2004
@@ -27,7 +27,7 @@
class InterfaceImplChecker:
- def _testObjectImpl(self, c):
+ def _test_object_imp(self, c):
try:
impl = c.__implements__
self._verify(impl, c)
@@ -35,15 +35,15 @@
print '%s incorrectly implements %s' % (repr(c), repr(impl))
raise
- def _testAllInModule(self, m):
+ def _test_all_in_module(self, m):
name = m.__name__
for attr, value in m.__dict__.items():
if (hasattr(value, '__implements__') and
not IInterface.isImplementedBy(value)
and getattr(value, '__module__', None) == name):
- self._testObjectImpl(value)
+ self._test_object_imp(value)
- def _testAllInPackage(self, p):
+ def _test_all_in_package(self, p):
seen = {'__init__': 1}
for path in p.__path__:
names = os.listdir(path)
@@ -56,7 +56,7 @@
seen[base] = 1
modname = '%s.%s' % (p.__name__, base)
m = __import__(modname, {}, {}, ('__doc__',))
- self._testAllInModule(m)
+ self._test_all_in_module(m)
def _verify(self, iface, c):
if isinstance(iface, ListType) or isinstance(iface, TupleType):
@@ -70,21 +70,21 @@
class ApelibImplTests(InterfaceImplChecker, unittest.TestCase):
- def testCoreImplementations(self):
+ def test_core_implementations(self):
import apelib.core
- self._testAllInPackage(apelib.core)
+ self._test_all_in_package(apelib.core)
- def testZope2Implementations(self):
+ def test_zope2_implementations(self):
import apelib.zope2
- self._testAllInPackage(apelib.zope2)
+ self._test_all_in_package(apelib.zope2)
- def testFSImplementations(self):
+ def test_fs_implementations(self):
import apelib.fs
- self._testAllInPackage(apelib.fs)
+ self._test_all_in_package(apelib.fs)
- def testZODB3Implementations(self):
+ def test_zodb3_implementations(self):
import apelib.zodb3
- self._testAllInPackage(apelib.zodb3)
+ self._test_all_in_package(apelib.zodb3)
if __name__ == '__main__':
unittest.main()
=== Products/Ape/lib/apelib/tests/testio.py 1.6 => 1.7 ===
--- Products/Ape/lib/apelib/tests/testio.py:1.6 Tue Feb 17 00:25:12 2004
+++ Products/Ape/lib/apelib/tests/testio.py Sat Mar 20 01:34:24 2004
@@ -29,7 +29,7 @@
class TestObjectDatabase:
__implements__ = IObjectDatabase
- def getObject(self, oid, hints=None):
+ def get(self, oid, hints=None):
raise NotImplementedError
def identify(self, obj):
@@ -38,7 +38,7 @@
def new_oid(self):
raise NotImplementedError
- def getClass(self, module, name):
+ def get_class(self, module, name):
m = __import__(module)
return getattr(m, name)
@@ -46,51 +46,51 @@
class ApeIOTests(SerialTestBase, unittest.TestCase):
- def getObjectDatabase(self):
+ def get_object_database(self):
return TestObjectDatabase()
- def testImpl(self):
+ def test_impl(self):
# Test of test :-)
from Interface.Verify import verifyClass
verifyClass(IObjectDatabase, TestObjectDatabase)
- def testSerializeAndDeserialize(self):
+ def test_serialize_and_deserialize(self):
ob = TestObject()
ob.strdata = '345'
ob['a'] = 'b'
ob['c'] = 'd'
oid = 'test'
- obj_db = self.getObjectDatabase()
+ obj_db = self.get_object_database()
obsys = io.ObjectSystemIO(self.conf, obj_db)
event, classification, state = obsys.serialize(oid, ob)
- ob2 = obsys.newObject(classification)
+ ob2 = obsys.new_instance(classification)
obsys.deserialize(oid, ob2, classification, state)
self.assertEqual(ob.strdata, ob2.strdata)
self.assertEqual(ob.data, ob2.data)
- def testStoreAndLoad(self):
+ def test_store_and_load(self):
# Tests both serialization and storage
ob = TestObject()
ob.strdata = '345'
ob['a'] = 'b'
ob['c'] = 'd'
oid = 'test'
- obj_db = self.getObjectDatabase()
+ obj_db = self.get_object_database()
obsys = io.ObjectSystemIO(self.conf, obj_db)
gwsys = io.GatewayIO(self.conf, self.conns)
event, classification, state = obsys.serialize(oid, ob)
gwsys.store(oid, classification, state, True)
event, classification, state, hash_value = gwsys.load(oid)
- ob2 = obsys.newObject(classification)
+ ob2 = obsys.new_instance(classification)
obsys.deserialize(oid, ob2, classification, state)
self.assertEqual(ob.strdata, ob2.strdata)
self.assertEqual(ob.data, ob2.data)
- def testExportImport(self):
+ def test_export_import(self):
root = PersistentMapping()
test1 = TestObject()
@@ -105,10 +105,10 @@
oid = ''
exporter = io.ExportImport(self.conf, self.conns)
- exporter.exportObject(root, oid)
+ exporter.export_object(root, oid)
importer = io.ExportImport(self.conf, self.conns)
- roota = importer.importObject(oid)
+ roota = importer.import_object(oid)
self.assert_(root is not roota)
self.assert_(root['TestRoot'] is not roota['TestRoot'])
self.assert_(root['TestRoot2'] is not roota['TestRoot2'])
=== Products/Ape/lib/apelib/tests/testparams.py 1.1 => 1.2 ===
--- Products/Ape/lib/apelib/tests/testparams.py:1.1 Wed Apr 9 23:09:57 2003
+++ Products/Ape/lib/apelib/tests/testparams.py Sat Mar 20 01:34:24 2004
@@ -18,14 +18,14 @@
import unittest
-from apelib.fs.params import stringToParams, paramsToString
+from apelib.fs.params import string_to_params, params_to_string
class ParamsTests(unittest.TestCase):
- def testStringToParams(self):
+ def test_string_to_params(self):
s = 'abc def="123 456\\n \\"done\\" " ghi=4 j567 \n'
- params = stringToParams(s)
+ params = string_to_params(s)
self.assertEqual(tuple(params), (
('abc', ''),
('def', '123 456\n "done" '),
@@ -33,27 +33,27 @@
('j567', ''),
))
- def testParamsToString(self):
+ def test_params_to_string(self):
params = (
('abc', ''),
('def', '123 456\n "done" '),
('ghi', '4'),
('j567', ''),
)
- s = paramsToString(params)
+ s = params_to_string(params)
self.assertEqual(s, 'abc def="123 456\\n \\"done\\" " ghi="4" j567')
- def testInvalidKeys(self):
- paramsToString((('abc_-09ABC', ''),))
- self.assertRaises(ValueError, paramsToString, (('a bc', ''),))
- self.assertRaises(ValueError, paramsToString, (('a\nbc', ''),))
- self.assertRaises(ValueError, paramsToString, (('', ''),))
- self.assertRaises(ValueError, paramsToString, ((' abc', ''),))
- self.assertRaises(ValueError, paramsToString, (('abc ', ''),))
- self.assertRaises(ValueError, paramsToString, (('a\tbc', ''),))
- self.assertRaises(ValueError, paramsToString, (('a\rbc', ''),))
- self.assertRaises(ValueError, paramsToString, (('a"bc', ''),))
- self.assertRaises(ValueError, paramsToString, (('0abc', ''),))
+ def test_invalid_keys(self):
+ params_to_string((('abc_-09ABC', ''),))
+ self.assertRaises(ValueError, params_to_string, (('a bc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('a\nbc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('', ''),))
+ self.assertRaises(ValueError, params_to_string, ((' abc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('abc ', ''),))
+ self.assertRaises(ValueError, params_to_string, (('a\tbc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('a\rbc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('a"bc', ''),))
+ self.assertRaises(ValueError, params_to_string, (('0abc', ''),))
if __name__ == '__main__':
=== Products/Ape/lib/apelib/tests/testscanner.py 1.5 => 1.6 ===
--- Products/Ape/lib/apelib/tests/testscanner.py:1.5 Sat Feb 28 15:06:28 2004
+++ Products/Ape/lib/apelib/tests/testscanner.py Sat Mar 20 01:34:24 2004
@@ -42,7 +42,7 @@
repo = FakeRepository()
- def getPollSources(self, oid):
+ def get_sources(self, oid):
return {(self.repo, str(oid)): 10}
@@ -54,33 +54,33 @@
storage.scanner = scanner
scanner.storage = storage
ctl = self.ctl = PoolScanControl(storage)
- self.conn1 = ctl.newConnection()
- self.conn2 = ctl.newConnection()
+ self.conn1 = ctl.new_connection()
+ self.conn2 = ctl.new_connection()
- def testSetNewOIDs(self):
- self.conn1.setOIDs([5, 8])
+ def test_set_new_oids(self):
+ self.conn1.set_oids([5, 8])
oids = list(self.ctl.oids.keys())
self.assertEqual(oids, [5, 8])
self.assertEqual(list(self.ctl.conn_oids.keys()), [self.conn1.conn_id])
- def testSetMultipleConnectionOIDs(self):
- self.conn1.setOIDs([5, 8])
- self.conn2.setOIDs([8, 9])
+ def test_set_multiple_connection_oids(self):
+ self.conn1.set_oids([5, 8])
+ self.conn2.set_oids([8, 9])
oids = list(self.ctl.oids.keys())
self.assertEqual(oids, [5,8,9])
conns = list(self.ctl.conn_oids.keys())
self.assertEqual(conns, [self.conn1.conn_id, self.conn2.conn_id])
- def testRemoveOIDs(self):
- self.conn1.setOIDs([5, 8])
- self.conn2.setOIDs([8, 9])
- self.conn1.setOIDs([8])
+ def test_remove_oids(self):
+ self.conn1.set_oids([5, 8])
+ self.conn2.set_oids([8, 9])
+ self.conn1.set_oids([8])
oids = list(self.ctl.oids.keys())
self.assertEqual(oids, [8,9])
conns = list(self.ctl.conn_oids.keys())
self.assertEqual(conns, [self.conn1.conn_id, self.conn2.conn_id])
- self.conn1.setOIDs([])
+ self.conn1.set_oids([])
oids = list(self.ctl.oids.keys())
self.assertEqual(oids, [8,9])
self.assertEqual(list(self.ctl.conn_oids.keys()), [self.conn2.conn_id])
@@ -94,75 +94,75 @@
storage.scanner = scanner
scanner.storage = storage
ctl = self.ctl = PoolScanControl(storage)
- self.conn1 = ctl.newConnection()
- self.conn2 = ctl.newConnection()
+ self.conn1 = ctl.new_connection()
+ self.conn2 = ctl.new_connection()
self.repo = FakeRepository()
- def testAddSource(self):
+ def test_add_source(self):
new_sources = {(self.repo, '5'): 0}
- self.scanner.afterLoad(5, new_sources)
+ self.scanner.after_load(5, new_sources)
self.assertEqual(len(self.scanner.future), 1)
self.assertEqual(self.scanner.future[5][0], new_sources)
- def testNoUpdatesWhenNotInvalidating(self):
+ def test_no_updates_when_not_invalidating(self):
# Don't change current except in scan(), where invalidation
# messages are possible.
- self.conn1.setOIDs([5])
+ self.conn1.set_oids([5])
sources = {(self.repo, '5'): 0}
- self.scanner.afterLoad(5, sources)
+ self.scanner.after_load(5, sources)
self.assertNotEqual(self.scanner.current[5], sources)
- def testRemoveOID(self):
- self.conn1.setOIDs([5])
+ def test_remove_oid(self):
+ self.conn1.set_oids([5])
self.assertEqual(len(self.scanner.current), 1)
- self.conn1.setOIDs([])
+ self.conn1.set_oids([])
self.assertEqual(len(self.scanner.current), 0)
- def testScan(self):
- self.conn1.setOIDs([5])
+ def test_scan(self):
+ self.conn1.set_oids([5])
new_sources = {(self.repo, '6'): 0, (self.repo, '7'): 0, }
- self.scanner.afterLoad(5, new_sources)
+ self.scanner.after_load(5, new_sources)
to_invalidate = self.scanner.scan()
self.assertEqual(len(to_invalidate), 1)
- def testPoolScan(self):
- self.conn1.setOIDs([5])
+ def test_pool_scan(self):
+ self.conn1.set_oids([5])
new_sources = {(self.repo, '6'): 0, (self.repo, '7'): 0, }
- self.scanner.afterLoad(5, new_sources)
+ self.scanner.after_load(5, new_sources)
# Just test that ctl.scan() executes without error.
self.ctl.scan()
- def testPruneFuture(self):
+ def test_prune_future(self):
# Simulate some data.
self.scanner.future[5] = ([], time()) # Should not be pruned
self.scanner.future[900] = ([], time() - 100000) # Should be pruned
- self.scanner.pruneFuture()
+ self.scanner.prune_future()
self.assertEqual(len(self.scanner.future), 1)
self.assert_(self.scanner.future.has_key(5))
- def testFindNewSources(self):
+ def test_find_new_sources(self):
# Verify the scanner calls storage.getSources() and saves the result.
- self.conn1.setOIDs([5])
- expect_sources = self.storage.getPollSources(5)
+ self.conn1.set_oids([5])
+ expect_sources = self.storage.get_sources(5)
self.assertEqual(self.scanner.current[5], expect_sources)
- def testUseCachedSources(self):
+ def test_use_cached_sources(self):
# Verify the scanner uses previously cached sources when available.
repo = FakeRepository()
sources = {(repo, '999'): -1}
- self.scanner.afterLoad(5, sources)
- self.conn1.setOIDs([5])
+ self.scanner.after_load(5, sources)
+ self.conn1.set_oids([5])
self.assertEqual(self.scanner.current[5], sources)
- def testUseCommittedSources(self):
+ def test_use_committed_sources(self):
# Verify the scanner updates sources according to transactions.
repo = FakeRepository()
sources = {(repo, '999'): -1}
- self.scanner.afterLoad(5, sources)
- self.conn1.setOIDs([5])
+ self.scanner.after_load(5, sources)
+ self.conn1.set_oids([5])
sources_2 = {(repo, '999'): -2}
- self.scanner.afterCommit(5, sources_2)
+ self.scanner.after_commit(5, sources_2)
final_sources = self.scanner.current[5]
self.assertEqual(len(final_sources), 1)
self.assertEqual(final_sources.keys()[0], (repo, '999'))
=== Products/Ape/lib/apelib/tests/testserialization.py 1.6 => 1.7 ===
--- Products/Ape/lib/apelib/tests/testserialization.py:1.6 Mon Feb 2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/testserialization.py Sat Mar 20 01:34:24 2004
@@ -47,7 +47,7 @@
No connections or object databases are provided.
"""
- def testSerializeAndDeserialize(self):
+ def test_serialize_and_deserialize(self):
ob = TestObject()
ob['a'] = 'b'
ob['c'] = 'd'
@@ -61,7 +61,7 @@
self.assertEqual(ob.strdata, ob2.strdata)
self.assertEqual(ob.data, ob2.data)
- def testStoreAndLoad(self):
+ def test_store_and_load(self):
ob = TestObject()
ob.strdata = '345'
ob['a'] = 'b'
@@ -81,7 +81,7 @@
self.assertEqual(ob.strdata, ob2.strdata)
self.assertEqual(ob.data, ob2.data)
- def testCatchExtraAttribute(self):
+ def test_catch_extra_attribute(self):
# The mapper for PersistentMappings doesn't allow an
# extra attribute.
ob = PersistentMapping()
@@ -93,7 +93,7 @@
event = SerializationEvent(self.conf, m, '', obj_db, ob)
self.assertRaises(SerializationError, m.serializer.serialize, event)
- def testSharedAttribute(self):
+ def test_shared_attribute(self):
# Test of an attribute shared between a normal serializer and
# a remainder serializer.
ob = TestObject()
=== Products/Ape/lib/apelib/tests/testsqlimpl.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/tests/testsqlimpl.py:1.2 Mon Feb 2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/testsqlimpl.py Sat Mar 20 01:34:24 2004
@@ -23,10 +23,10 @@
class ApelibSQLImplTests(InterfaceImplChecker, unittest.TestCase):
- def testSQLImplementations(self):
+ def test_sql_implementations(self):
import apelib.sql
import apelib.sql.oidgen
- self._testAllInPackage(apelib.sql)
+ self._test_all_in_package(apelib.sql)
if __name__ == '__main__':
unittest.main()
=== Products/Ape/lib/apelib/tests/teststorage.py 1.8 => 1.9 ===
--- Products/Ape/lib/apelib/tests/teststorage.py:1.8 Mon Mar 1 09:13:54 2004
+++ Products/Ape/lib/apelib/tests/teststorage.py Sat Mar 20 01:34:24 2004
@@ -25,7 +25,7 @@
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
-from apelib.zodb3.utils import copyOf
+from apelib.zodb3.utils import zodb_copy
from apelib.core.interfaces import OIDConflictError
from serialtestbase import SerialTestBase, TestObject
@@ -60,7 +60,7 @@
self.db.close()
SerialTestBase.tearDown(self)
- def testStoreAndLoad(self):
+ def test_store_and_load(self):
ob = TestObject()
ob.strdata = '345'
ob['a'] = 'b'
@@ -113,7 +113,7 @@
conn3.close()
- def testUnmanaged(self):
+ def test_unmanaged(self):
ob = TestObject()
ob['a'] = 'b'
ob.stowaway = PersistentMapping()
@@ -177,7 +177,7 @@
conn3.close()
- def testStoreAndLoadBinary(self):
+ def test_store_and_load_binary(self):
ob = TestObject()
# strdata contains binary characters
ob.strdata = ''.join([chr(n) for n in range(256)]) * 2
@@ -195,7 +195,7 @@
conn1.close()
- def _writeBasicObject(self, conn):
+ def _write_basic_object(self, conn):
ob = TestObject()
ob.strdata = 'abc'
root = conn.root()
@@ -205,7 +205,7 @@
return ob
- def _changeTestRoot(self):
+ def _change_test_root(self):
conn = self.db.open()
try:
ob = conn.root()['TestRoot']
@@ -215,12 +215,12 @@
conn.close()
- def testConflictDetection(self):
+ def test_conflict_detection(self):
conn1 = self.db.open()
try:
- ob1 = self._writeBasicObject(conn1)
+ ob1 = self._write_basic_object(conn1)
ob1.strdata = 'def'
- run_in_thread(self._changeTestRoot)
+ run_in_thread(self._change_test_root)
# Verify that "def" doesn't get written, since it
# conflicts with "ghi".
self.assertRaises(ZODB.POSException.ConflictError,
@@ -230,19 +230,19 @@
conn1.close()
- def testNewObjectConflictDetection(self):
+ def test_new_object_conflict_detection(self):
# Verify a new object won't overwrite existing objects by accident
conn1 = self.db.open()
try:
- ob1 = self._writeBasicObject(conn1)
+ ob1 = self._write_basic_object(conn1)
ob1.strdata = 'def'
- conn1.setSerial(ob1, '\0' * 8) # Pretend that it's new
+ conn1._set_serial(ob1, '\0' * 8) # Pretend that it's new
self.assertRaises(OIDConflictError, get_transaction().commit)
finally:
conn1.close()
- def testRemainderCyclicReferenceRestoration(self):
+ def test_remainder_cyclic_reference_restoration(self):
# test whether the remainder pickler properly stores cyclic references
# back to the object itself.
ob1 = TestObject()
@@ -266,8 +266,8 @@
conn1.close()
- def testCopyOf(self):
- # Verifies the functionality of copyOf().
+ def test_copy_of(self):
+ # Verifies the functionality of zodb_copy().
ob1 = PersistentMapping()
ob1._p_oid = 'xxx'
self.assertEqual(ob1._p_oid, 'xxx') # Precondition
@@ -275,7 +275,7 @@
ob1['fish']['trout'] = 1
ob1['fish']['herring'] = 2
- ob2 = copyOf(ob1)
+ ob2 = zodb_copy(ob1)
self.assert_(ob2 is not ob1)
self.assert_(ob2['fish'] is not ob1['fish'])
self.assert_(ob2._p_oid is None)
@@ -283,8 +283,8 @@
self.assertEqual(len(ob2['fish'].keys()), 2)
- def testCopyOfZClassInstance(self):
- # Verifies that copyOf() can copy instances that look like ZClass
+ def test_copy_of_zclass_instance(self):
+ # Verifies that zodb_copy() can copy instances that look like ZClass
# instances.
class weird_class (Persistent):
pass
@@ -294,7 +294,7 @@
ob1 = PersistentMapping()
ob1['fishy'] = weird_class()
- ob2 = copyOf(ob1)
+ ob2 = zodb_copy(ob1)
self.assert_(ob2 is not ob1)
self.assert_(ob2['fishy'] is not ob1['fishy'])
self.assert_(ob2['fishy'].__class__ is weird_class)
@@ -306,42 +306,42 @@
# use _p_serial for hashes.
conn1 = self.db.open()
try:
- ob1 = self._writeBasicObject(conn1)
+ ob1 = self._write_basic_object(conn1)
self.assertEqual(ob1._p_serial, "\0" * 8)
finally:
conn1.close()
- def testGetSerial(self):
- # Verifies the behavior of getSerial().
+ def test_get_serial(self):
+ # Verifies the behavior of _get_serial().
conn1 = self.db.open()
try:
new_ob = TestObject()
- self.assertEqual(conn1.getSerial(new_ob), '\0' * 8)
- ob1 = self._writeBasicObject(conn1)
- self.assertNotEqual(conn1.getSerial(ob1), '\0' * 8)
+ self.assertEqual(conn1._get_serial(new_ob), '\0' * 8)
+ ob1 = self._write_basic_object(conn1)
+ self.assertNotEqual(conn1._get_serial(ob1), '\0' * 8)
finally:
conn1.close()
- def testGetSerialDetectsNewObjects(self):
- # Verifies the behavior of getSerial() and setSerial().
+ def test_get_serial_detects_new_objects(self):
+ # Verifies the behavior of _get_serial() and _set_serial().
conn1 = self.db.open()
try:
- ob = self._writeBasicObject(conn1)
- self.assertNotEqual(conn1.getSerial(ob), '\0' * 8)
+ ob = self._write_basic_object(conn1)
+ self.assertNotEqual(conn1._get_serial(ob), '\0' * 8)
# Replace the object and verify it gets a new serial.
ob1 = PersistentMapping()
ob1.strdata = 'cba'
ob1._p_oid = conn1.root()['TestRoot']._p_oid
conn1.root()['TestRoot'] = ob1
- self.assertEqual(conn1.getSerial(ob1), '\0' * 8)
+ self.assertEqual(conn1._get_serial(ob1), '\0' * 8)
finally:
conn1.close()
- def testSerialCleanup(self):
- # Verify that setSerial() cleans up.
+ def test_serial_cleanup(self):
+ # Verify that _set_serial() cleans up.
conn1 = self.db.open()
try:
conn1.serial_cleanup_threshold = 10
@@ -349,32 +349,32 @@
new_ob = PersistentMapping()
new_ob._p_oid = 'fake_oid_' + str(n)
old_size = len(conn1._serials or ())
- conn1.setSerial(new_ob, '01234567')
+ conn1._set_serial(new_ob, '01234567')
new_size = len(conn1._serials)
if new_size < old_size:
# Cleaned up. Success.
break
else:
- self.fail("setSerial() did not clean up")
+ self.fail("_set_serial() did not clean up")
finally:
conn1.close()
- def testGetPollSources(self):
+ def test_get_sources(self):
root_oid = self.conf.oid_gen.root_oid
- sources = self.storage.getPollSources(root_oid)
+ sources = self.storage.get_sources(root_oid)
self.assert_(not sources)
# The test passed, but check for a false positive.
oid = 'nonexistent-oid'
- self.assertRaises(KeyError, self.storage.getPollSources, oid)
+ self.assertRaises(KeyError, self.storage.get_sources, oid)
- def testCleanChanged(self):
+ def test_clean_changed(self):
# Verify the storage discards the list of changed objects on
# commit or abort.
conn1 = self.db.open()
try:
- ob1 = self._writeBasicObject(conn1)
+ ob1 = self._write_basic_object(conn1)
self.assertEqual(len(self.storage.changed), 0)
ob1.strdata = 'def'
get_transaction().abort()
=== Products/Ape/lib/apelib/tests/testzodbtables.py 1.2 => 1.3 ===
--- Products/Ape/lib/apelib/tests/testzodbtables.py:1.2 Mon Feb 2 10:07:22 2004
+++ Products/Ape/lib/apelib/tests/testzodbtables.py Sat Mar 20 01:34:24 2004
@@ -50,10 +50,10 @@
class ZODBTableTests(unittest.TestCase):
table_schema = zodbtables.TableSchema()
- table_schema.addColumn('name', primary=1, indexed=1)
- table_schema.addColumn('sex', indexed=1)
- table_schema.addColumn('address')
- table_schema.addColumn('phone', indexed=1)
+ table_schema.add('name', primary=1, indexed=1)
+ table_schema.add('sex', indexed=1)
+ table_schema.add('address')
+ table_schema.add('phone', indexed=1)
def setUp(self):
self.table = table = zodbtables.Table(self.table_schema)
@@ -63,86 +63,86 @@
def tearDown(self):
get_transaction().abort()
- def testSelectByName(self):
+ def test_select_by_name(self):
# Searches by primary key
records = self.table.select({'name': 'Jose'})
self.assertEqual(len(records), 1)
self.assertEqual(records[0]['address'], '101 Example St.')
- def testSelectByUnknownName(self):
+ def test_select_by_unknown_name(self):
# Searches by primary key
records = self.table.select({'name': 'Joao'})
self.assertEqual(len(records), 0)
- def testSelectByPhone(self):
+ def test_select_by_phone(self):
# Searches by index
records = self.table.select({'phone': '987-6543'})
self.assertEqual(len(records), 1)
self.assertEqual(records[0]['name'], 'Carlos')
- def testSelectByAddress(self):
+ def test_select_by_address(self):
# Searches one-by-one
records = self.table.select({'address': '102 Example St.'})
self.assertEqual(len(records), 1)
self.assertEqual(records[0]['name'], 'Maria')
- def testSelectMales(self):
+ def test_select_males(self):
records = self.table.select({'sex': 'm'})
self.assertEqual(len(records), 3)
- def testSelectFemales(self):
+ def test_select_females(self):
records = self.table.select({'sex': 'f'})
self.assertEqual(len(records), 2)
- def testSelectByNameAndSex(self):
+ def test_select_by_name_and_sex(self):
records = self.table.select({'name': 'Jose', 'sex': 'm'})
self.assertEqual(len(records), 1)
- def testSelectByNameAndIncorrectSex(self):
+ def test_select_by_name_and_incorrect_sex(self):
records = self.table.select({'name': 'Jose', 'sex': 'f'})
self.assertEqual(len(records), 0)
- def testSelectBySexAndPhone(self):
+ def test_Select_By_Sex_And_Phone(self):
# Intersects two indexes
records = self.table.select({'phone': '123-4567', 'sex': 'm'})
self.assertEqual(len(records), 2)
- def testSelectAll(self):
+ def test_select_all(self):
records = self.table.select({})
self.assertEqual(len(records), 5)
- def testInsertMinimal(self):
+ def test_insert_minimal(self):
self.table.insert({'name': 'Edson'})
- def testInsertDuplicate(self):
+ def test_insert_duplicate(self):
self.assertRaises(zodbtables.DuplicateError,
self.table.insert, {'name':'Carlos'})
- def testInsertWithoutPrimaryKey(self):
+ def test_insert_without_primary_key(self):
self.assertRaises(ValueError, self.table.insert, {})
- def testUpdateNewAddress(self):
+ def test_update_new_address(self):
# Test adding a value in a non-indexed column
self.table.update({'name': 'Carlos'}, {'address': '99 Sohcahtoa Ct.'})
records = self.table.select({'address': '99 Sohcahtoa Ct.'})
self.assertEqual(len(records), 1)
self.assertEqual(records[0]['name'], 'Carlos')
- def testUpdateChangeAddress(self):
+ def test_Update_Change_Address(self):
# Test changing a value in a non-indexed column
self.table.update({'name': 'Jose'}, {'address': '99 Sohcahtoa Ct.'})
records = self.table.select({'address': '99 Sohcahtoa Ct.'})
self.assertEqual(len(records), 1)
self.assertEqual(records[0]['name'], 'Jose')
- def testUpdateFemaleAddresses(self):
+ def test_update_female_addresses(self):
# Test changing and adding simultaneously in a non-indexed column
self.table.update({'sex': 'f'}, {'address': '99 Sohcahtoa Ct.'})
records = self.table.select({'address': '99 Sohcahtoa Ct.'})
self.assertEqual(len(records), 2)
- def testUpdateChangePhone(self):
+ def test_update_change_phone(self):
# Test changing a value in an indexed column
records = self.table.select({'phone': '123-4567'})
self.assertEqual(len(records), 3) # Precondition
@@ -155,7 +155,7 @@
self.assertEqual(records[0]['name'], 'Jose')
- def testUpdateChangeName(self):
+ def test_update_change_name(self):
# Test changing a value in a primary key column
records = self.table.select({'name': 'Jose'})
self.assertEqual(len(records), 1) # Precondition
@@ -167,19 +167,19 @@
self.assertEqual(len(records), 1)
- def testUpdateNameConflict(self):
+ def test_update_name_conflict(self):
self.assertRaises(zodbtables.DuplicateError, self.table.update,
{'name':'Jose'}, {'name': 'Carlos'})
- def testDeleteNothing(self):
+ def test_delete_nothing(self):
old_count = len(self.table.select({}))
self.assertEqual(self.table.delete({'name': 'Edson'}), 0)
new_count = len(self.table.select({}))
self.assert_(old_count == new_count)
- def testDeleteAll(self):
+ def test_delete_all(self):
count = len(self.table.select({}))
self.assert_(count > 0)
self.assertEqual(self.table.delete({}), count)
@@ -187,7 +187,7 @@
self.assert_(new_count == 0)
- def testDeleteOne(self):
+ def test_delete_one(self):
# Test deletion of one row
records = self.table.select({'name': 'Jose'})
self.assertEqual(len(records), 1) # Precondition
@@ -202,7 +202,7 @@
self.assertEqual(len(records), 2)
- def testDeleteByPhone(self):
+ def test_delete_by_phone(self):
records = self.table.select({'phone': '123-4567'})
self.assertEqual(len(records), 3) # Precondition
@@ -217,11 +217,11 @@
records = self.table.select({'name': 'Maria'})
self.assertEqual(len(records), 1)
- def testSelectPartialPrimaryKey(self):
+ def test_select_partial_primary_key(self):
# Select by only one part of a primary key
schema = zodbtables.TableSchema()
- schema.addColumn('name', primary=1)
- schema.addColumn('id', primary=1)
+ schema.add('name', primary=1)
+ schema.add('id', primary=1)
table = zodbtables.Table(schema)
table.insert({'name': 'joe', 'id': 1})
table.insert({'name': 'john', 'id': 2})
@@ -233,19 +233,19 @@
# Same tests but with no primary key. The absence of a primary
# key affects many branches of the code.
table_schema = zodbtables.TableSchema()
- table_schema.addColumn('name', indexed=1)
- table_schema.addColumn('sex', indexed=1)
- table_schema.addColumn('address')
- table_schema.addColumn('phone', indexed=1)
+ table_schema.add('name', indexed=1)
+ table_schema.add('sex', indexed=1)
+ table_schema.add('address')
+ table_schema.add('phone', indexed=1)
# Disabled tests
- def testInsertWithoutPrimaryKey(self):
+ def test_insert_without_primary_key(self):
pass
- def testInsertDuplicate(self):
+ def test_insert_duplicate(self):
pass
- def testUpdateNameConflict(self):
+ def test_update_name_conflict(self):
pass
=== Products/Ape/lib/apelib/tests/testzope2fs.py 1.8 => 1.9 ===
--- Products/Ape/lib/apelib/tests/testzope2fs.py:1.8 Wed Mar 17 20:05:12 2004
+++ Products/Ape/lib/apelib/tests/testzope2fs.py Sat Mar 20 01:34:24 2004
@@ -32,7 +32,7 @@
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
-from apelib.zope2.mapper import loadConf
+from apelib.zope2.mapper import load_conf
from apelib.fs.interfaces import FSWriteError
from apelib.fs.connection import FSConnection
from zope2testbase import Zope2TestBase, Folder
@@ -53,7 +53,7 @@
annotation_prefix = '.'
def setUp(self):
- self.db, self.conn = self.openDatabase()
+ self.db, self.conn = self.open_database()
self.conf = conf
self.path = tmpdir
c = self.db.open()
@@ -65,7 +65,7 @@
finally:
c.close()
get_transaction().begin()
- self.clearCaches()
+ self.clear_caches()
def tearDown(self):
get_transaction().abort()
@@ -73,10 +73,10 @@
self.db.close()
rmtree(self.path)
- def openDatabase(self):
+ def open_database(self):
global conf
if conf is None:
- conf = loadConf('filesystem')
+ conf = load_conf('filesystem')
if not os.path.exists(tmpdir):
os.mkdir(tmpdir)
conn = FSConnection(tmpdir, annotation_prefix=self.annotation_prefix)
@@ -86,12 +86,12 @@
db = ApeDB(storage, resource, cache_size=0)
return db, conn
- def clearCaches(self):
+ def clear_caches(self):
"""Clears caches after a filesystem write.
"""
- self.conn.afs.clearCache()
+ self.conn.afs.clear_cache()
- def testClassificationPreservation(self):
+ def test_classification_preservation(self):
# Ensure that classification doesn't get forgotten.
conn = self.db.open()
try:
@@ -112,13 +112,13 @@
get_transaction().commit()
for folder in (f, f2, f3):
- text = self.conn.readAnnotation(folder._p_oid, 'classification')
+ text = self.conn.read_annotation(folder._p_oid, 'classification')
self.assert_(text.find('class_name=OFS.Folder.Folder') >= 0)
finally:
conn.close()
- def testIgnoreMismatchedId(self):
+ def test_ignore_mismatched_id(self):
# Verify that FSAutoID doesn't care if the ID of an item
# doesn't match what the folder thinks the item's ID should
# be.
@@ -137,7 +137,7 @@
conn.close()
- def testReusePath(self):
+ def test_reuse_path(self):
# Verifies that ApeConnection doesn't trip over reuse of a path that's
# no longer in use.
conn = self.db.open()
@@ -160,7 +160,7 @@
conn.close()
- def testAutomaticPageTemplateExtension(self):
+ def test_automatic_page_template_extension(self):
text = '<span tal:content="string:Hello">example</span>'
conn = self.db.open()
try:
@@ -177,7 +177,7 @@
conn.close()
- def testPreserveNamesWithoutExtensions(self):
+ def test_preserve_names_without_extensions(self):
# Verifies that FSConnection retains original object names,
# even though the files might be stored with extensions.
conn = self.db.open()
@@ -211,7 +211,7 @@
conn.close()
- def testPreserveNamesWithExtensions(self):
+ def test_preserve_names_with_extensions(self):
# Verifies that FSConnection retains original object names
# even though the object names already have extensions.
conn = self.db.open()
@@ -245,7 +245,7 @@
conn.close()
- def testAutoRenameOnExtensionConflict(self):
+ def test_auto_rename_on_extension_conflict(self):
# When you create a Python Script called "script0", Ape adds a
# .py extension. If, in a second transaction, you add
# "script0.py", Ape must rename the current "script0.py" to
@@ -285,7 +285,7 @@
conn.close()
- def testNonConflictingNameExtensions1(self):
+ def test_non_conflicting_name_extensions1(self):
# Verifies that FSConnection can write to 'script0.py' then 'script0'
conn = self.db.open()
try:
@@ -322,7 +322,7 @@
conn.close()
- def testNonConflictingNameExtensions2(self):
+ def test_non_conflicting_name_extensions2(self):
# Verifies that FSConnection can write to 'script0.py' and 'script0'
# at the same time
conn = self.db.open()
@@ -353,7 +353,7 @@
conn.close()
- def testNonConflictingNameExtensions3(self):
+ def test_non_conflicting_name_extensions3(self):
# Verifies that FSConnection can write to 'script0.py'
# then 'script0.dtml', then 'script0'.
# Then verifies that removal of items works correctly.
@@ -428,7 +428,7 @@
conn.close()
- def testImageExtension(self):
+ def test_image_extension(self):
# Verify that a new image is stored with the correct extension.
path = os.path.join(os.path.dirname(__file__), 'correct.png')
f = open(path, 'rb')
@@ -458,7 +458,7 @@
conn.close()
- def testCorrectedFileExtension(self):
+ def test_corrected_file_extension(self):
# Verify that certain content_types use the correct filename
# extension.
data = 'Hello, world!'
@@ -483,7 +483,7 @@
conn.close()
- def testGuessTypeBasedOnExtension(self):
+ def test_guess_type_based_on_extension(self):
# Verify Zope chooses the right object type for
# a new object.
# White box test.
@@ -491,7 +491,7 @@
f = open(os.path.join(dir, 'test.py'), 'wt')
f.write('return "Ok!"')
f.close()
- self.clearCaches()
+ self.clear_caches()
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -502,7 +502,7 @@
conn.close()
- def testGuessTypeWithChoppedExtension(self):
+ def test_guess_type_with_chopped_extension(self):
# Verify that even though the extension gets stripped off
# in Zope, Zope still sees the object as it should.
# White box test.
@@ -515,7 +515,7 @@
+ 'properties'), 'wt')
f.write('[object_names]\ntest\n')
f.close()
- self.clearCaches()
+ self.clear_caches()
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -526,7 +526,7 @@
conn.close()
- def testFallbackToFile(self):
+ def test_fallback_to_file(self):
# Verify Zope uses a File object for unrecognized files on
# the filesystem. White box test.
data = 'data goes here'
@@ -534,7 +534,7 @@
f = open(os.path.join(dir, 'test'), 'wt')
f.write(data)
f.close()
- self.clearCaches()
+ self.clear_caches()
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -545,12 +545,12 @@
conn.close()
- def testDefaultPropertySchema(self):
+ def test_default_property_schema(self):
# Verify Zope uses the default property schema when no properties
# are set.
dir = self.conn.basepath
os.mkdir(os.path.join(dir, 'test'))
- self.clearCaches()
+ self.clear_caches()
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -567,7 +567,7 @@
conn.close()
- def testRemainderStorage(self):
+ def test_remainder_storage(self):
# Verify that FSConnection puts the remainder in the properties file
conn = self.db.open()
try:
@@ -596,7 +596,7 @@
conn.close()
- def testDottedNames(self):
+ def test_dotted_names(self):
# FSConnection should allow dotted names that don't look like
# property or remainder files.
conn = self.db.open()
@@ -613,7 +613,7 @@
conn.close()
- def testGuessFileContentType(self):
+ def test_guess_file_content_type(self):
# Verify that file content type guessing happens.
data = '<html><body>Cool stuff</body></html>'
dir = self.conn.basepath
@@ -630,7 +630,7 @@
conn.close()
- def testWriteToRoot(self):
+ def test_write_to_root(self):
# Verify it's possible to write to the _root object as well as
# the Application object without either one stomping on each
# other's data.
@@ -656,7 +656,7 @@
conn2.close()
- def testOpenExisting(self):
+ def test_open_existing(self):
# Verifies that opening an existing database finds the same
# data.
conn = self.db.open()
@@ -671,7 +671,7 @@
# directory.
self.db.close()
self.db = None
- self.db, self.conn = self.openDatabase()
+ self.db, self.conn = self.open_database()
conn = self.db.open()
try:
root = conn.root()
@@ -681,7 +681,7 @@
conn.close()
- def testNoClobberOnOpen(self):
+ def test_no_clobber_on_open(self):
# Opening a database with no "_root" shouldn't clobber the
# existing contents.
conn = self.db.open()
@@ -701,13 +701,13 @@
root_p = os.path.join(basepath, '_root')
if os.path.exists(root_p):
rmtree(root_p)
- paths = self.conn.afs.getAnnotationPaths(basepath)
+ paths = self.conn.afs.get_annotation_paths(basepath)
for path in paths:
if os.path.exists(path):
os.remove(path)
# Now look for the 'bar' folder.
- self.db, self.conn = self.openDatabase()
+ self.db, self.conn = self.open_database()
conn = self.db.open()
try:
root = conn.root()
@@ -716,7 +716,7 @@
finally:
conn.close()
- def testStartWithEmptyDatabase(self):
+ def test_start_with_empty_database(self):
# A new database should not have an Application.
# Destroy the _root and the annotations at the app root.
self.db.close()
@@ -724,7 +724,7 @@
basepath = self.conn.basepath
rmtree(basepath)
os.mkdir(basepath)
- self.db, self.conn = self.openDatabase()
+ self.db, self.conn = self.open_database()
conn = self.db.open()
try:
root = conn.root()
@@ -732,7 +732,7 @@
finally:
conn.close()
- def testStoreUnlinked(self):
+ def test_store_unlinked(self):
# Storing an object not linked to any parents
# shouldn't cause problems.
conn = self.db.open()
=== Products/Ape/lib/apelib/tests/testzope2sql.py 1.9 => 1.10 ===
--- Products/Ape/lib/apelib/tests/testzope2sql.py:1.9 Wed Mar 17 10:55:50 2004
+++ Products/Ape/lib/apelib/tests/testzope2sql.py Sat Mar 20 01:34:24 2004
@@ -23,7 +23,7 @@
from apelib.zodb3.db import ApeDB
from apelib.zodb3.storage import ApeStorage
from apelib.zodb3.resource import StaticResource
-from apelib.zope2.mapper import loadConf
+from apelib.zope2.mapper import load_conf
from zope2testbase import Zope2TestBase
@@ -35,15 +35,15 @@
class_name = None
connect_args = '' # Python expression for connect()
- def getConnection(self):
+ def get_connection(self):
c = getattr(apelib.sql.dbapi, self.class_name)
return c(self.dbapi_module, self.connect_args, prefix="apetest_")
def setUp(self):
global conf
if conf is None:
- conf = loadConf('sql')
- conn = self.getConnection()
+ conf = load_conf('sql')
+ conn = self.get_connection()
self.conf = conf
resource = StaticResource(self.conf)
self.conns = {'db': conn}
@@ -65,14 +65,14 @@
raise
def clear(self):
- self.storage.initDatabases(clear_all=1)
+ self.storage.init_databases(clear_all=1)
def tearDown(self):
get_transaction().abort()
self.clear()
self.db.close()
- def testConnect(self):
+ def test_connect(self):
# Tests the setUp/tearDown methods
pass
@@ -102,8 +102,8 @@
'Skipping %s.\n'
% (repr(mname), k))
else:
- case = v('testConnect')
- conn = case.getConnection()
+ case = v('test_connect')
+ conn = case.get_connection()
try:
conn.connect()
conn.close()
=== Products/Ape/lib/apelib/tests/zope2testbase.py 1.11 => 1.12 ===
--- Products/Ape/lib/apelib/tests/zope2testbase.py:1.11 Wed Mar 17 20:08:14 2004
+++ Products/Ape/lib/apelib/tests/zope2testbase.py Sat Mar 20 01:34:24 2004
@@ -63,7 +63,7 @@
class Zope2TestBase:
- def testLoad(self):
+ def test_load(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -71,7 +71,7 @@
finally:
conn.close()
- def testStore(self):
+ def test_store(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -104,7 +104,7 @@
finally:
conn.close()
- def testAnyFolderishStorage(self):
+ def test_anyfolder_storage(self):
# Try to store a folderish object of an otherwise unknown class
conn = self.db.open()
try:
@@ -137,7 +137,7 @@
conn.close()
- def testAnyFolderWithoutPropertiesStorage(self):
+ def test_anyfolder_without_properties_storage(self):
# Try to store a folderish object that does not implement
# PropertyManager (tests OptionalSerializer)
conn = self.db.open()
@@ -161,7 +161,7 @@
conn.close()
- def testAnyFileishStorage(self):
+ def test_anyfile_storage(self):
# Try to store a fileish object of an otherwise unknown class
conn = self.db.open()
try:
@@ -191,7 +191,7 @@
conn.close()
- def testStoreProperties(self):
+ def test_store_properties(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -228,7 +228,7 @@
conn.close()
- def testStoreSelectionProperties(self):
+ def test_store_selection_properties(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -270,7 +270,7 @@
- def testStorePropertyTypes(self):
+ def test_store_property_types(self):
# Test that Ape restores properties to the correct types.
from DateTime import DateTime
now = DateTime()
@@ -320,7 +320,7 @@
conn.close()
- def testStoreUserFolder(self):
+ def test_store_user_folder(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -364,19 +364,19 @@
conn.close()
- def testNewObjectConflictDetection(self):
+ def test_new_object_conflict_detection(self):
# Verify a new object won't overwrite existing objects by accident
conn = self.db.open()
try:
app = conn.root()['Application']
app.some_attr = 'stuff'
- conn.setSerial(app, '\0' * 8) # Pretend that it's new
+ conn._set_serial(app, '\0' * 8) # Pretend that it's new
self.assertRaises(OIDConflictError, get_transaction().commit)
finally:
conn.close()
- def testRename(self):
+ def test_rename(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -407,7 +407,7 @@
conn.close()
- def testLargeFile(self):
+ def test_large_file(self):
# Verify that 256K file objects can be serialized/deserialized.
# Zope splits files larger than 64K into chunks.
data = 'data' * 65536
@@ -428,7 +428,7 @@
conn.close()
- def testFilePreservesContentType(self):
+ def test_file_preserves_content_type(self):
# Verify that a file's content_type is preserved.
# Note that there is some contention between content_type
# guessing and the content_type property.
@@ -456,7 +456,7 @@
conn.close()
- def testPageTemplate(self):
+ def test_page_template(self):
text = '<span tal:content="string:Hello">example</span>'
expected = '<span>Hello</span>'
conn = self.db.open()
@@ -478,7 +478,7 @@
conn.close()
- def testPythonScript(self, with_proxy_roles=0):
+ def test_python_script(self, with_proxy_roles=0):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -505,13 +505,13 @@
conn.close()
- def testPythonScriptWithProxyRoles(self):
+ def test_python_script_with_proxy_roles(self):
# This once failed because PythonScripts check proxy roles
# on calls to write().
- self.testPythonScript(with_proxy_roles=1)
+ self.test_python_script(with_proxy_roles=1)
- def testDTMLMethod(self):
+ def test_dtml_method(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -536,7 +536,7 @@
conn.close()
- def testZSQLMethod(self):
+ def test_zsql_method(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -559,7 +559,7 @@
conn.close()
- def testSecurityAttributes(self):
+ def test_security_attributes(self):
conn = self.db.open()
try:
app = conn.root()['Application']
@@ -624,7 +624,7 @@
conn.close()
- def testModTime(self):
+ def test_mod_time(self):
# Verify _p_mtime is within a reasonable range.
conn = self.db.open()
try:
@@ -638,7 +638,7 @@
conn.close()
- def testWriteWithGhosts(self):
+ def test_write_with_ghosts(self):
# It should be possible to write a container even if one
# or more of its subobjects are ghosts.
conn = self.db.open()
@@ -661,7 +661,7 @@
conn.close()
- def testBTreeFolder2(self):
+ def test_btreefolder2(self):
from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2
conn = self.db.open()
try:
@@ -698,7 +698,7 @@
conn.close()
- def testDeactivateUnmanagedPersistent(self):
+ def test_deactivate_unmanaged_persistent(self):
# Some Zope code deactivates unmanaged persistent objects.
# Verify that Ape can handle it.
conn = self.db.open()
More information about the Zope-CVS
mailing list