[Zope-CVS] CVS: Products/Ape/lib/apelib/tests - testscanner.py:1.1.2.2
Shane Hathaway
shane@zope.com
Thu, 24 Jul 2003 08:16:14 -0400
Update of /cvs-repository/Products/Ape/lib/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv8851/lib/apelib/tests
Modified Files:
Tag: ape-scan-branch
testscanner.py
Log Message:
Modified strategy that asks gateways for sources directly.
=== Products/Ape/lib/apelib/tests/testscanner.py 1.1.2.1 => 1.1.2.2 ===
--- Products/Ape/lib/apelib/tests/testscanner.py:1.1.2.1 Wed Jul 23 00:12:49 2003
+++ Products/Ape/lib/apelib/tests/testscanner.py Thu Jul 24 08:15:39 2003
@@ -83,26 +83,25 @@
self.repo = FakeRepository()
def testAddSource(self):
- source = (self.repo, '5')
- self.scanner.setSources(5, [source])
+ new_sources = {(self.repo, '5'): 0}
+ self.scanner.setSources(5, new_sources)
self.assertEqual(len(self.scanner.future), 1)
- self.assertEqual(self.scanner.future[5][0], [source])
+ self.assertEqual(self.scanner.future[5][0], new_sources)
def testChangeSources(self):
self.conn1.setOIDs([5])
- old_sources = [(self.repo, '5')]
+ old_sources = {(self.repo, '5'): 0}
self.scanner.setSources(5, old_sources)
self.assertEqual(len(self.scanner.future), 0)
self.assertEqual(len(self.scanner.current), 1)
- self.assertEqual(self.scanner.current[5], {old_sources[0]: None})
+ self.assertEqual(self.scanner.current[5], old_sources)
- new_sources = [(self.repo, '6'), (self.repo, '7')]
+ new_sources = {(self.repo, '6'): 0, (self.repo, '7'): 0, }
self.scanner.setSources(5, new_sources)
self.assertEqual(len(self.scanner.future), 0)
self.assertEqual(len(self.scanner.current), 1)
- self.assertEqual(self.scanner.current[5],
- {new_sources[0]: None, new_sources[1]: None})
+ self.assertEqual(self.scanner.current[5], new_sources)
def testRemoveOID(self):
self.conn1.setOIDs([5])
@@ -110,18 +109,10 @@
self.conn1.setOIDs([])
self.assertEqual(len(self.scanner.current), 0)
- def testNewScan(self):
- self.conn1.setOIDs([5])
- new_sources = [(self.repo, '6'), (self.repo, '7')]
- self.scanner.setSources(5, new_sources)
- to_invalidate = self.scanner.scan()
- self.assertEqual(len(to_invalidate), 0)
-
- def testUpdateScan(self):
+ def testScan(self):
self.conn1.setOIDs([5])
- new_sources = [(self.repo, '6'), (self.repo, '7')]
+ new_sources = {(self.repo, '6'): 0, (self.repo, '7'): 0, }
self.scanner.setSources(5, new_sources)
- to_invalidate = self.scanner.scan()
to_invalidate = self.scanner.scan()
self.assertEqual(len(to_invalidate), 1)