예제 #1
0
 def test00_dump_creation(self):
     i=ResourceList()
     i.add( Resource('http://ex.org/a', size=1, path='resync/test/testdata/a') )
     i.add( Resource('http://ex.org/b', size=2, path='resync/test/testdata/b') )
     d=Dump()
     d.check_files(resourcelist=i)
     self.assertEqual(d.total_size, 28)
예제 #2
0
파일: test_dump.py 프로젝트: pedak/sync-oai
 def test00_dump_creation(self):
     i=Inventory()
     i.add( ResourceFile('http://ex.org/a', size=1, file='resync/test/testdata/a') )
     i.add( ResourceFile('http://ex.org/b', size=2, file='resync/test/testdata/b') )
     d=Dump()
     d.check_files(inventory=i)
     self.assertEqual(d.total_size, 28)
예제 #3
0
 def test00_dump_creation(self):
     i = ResourceList()
     i.add(Resource("http://ex.org/a", length=1, path="resync/test/testdata/a"))
     i.add(Resource("http://ex.org/b", length=2, path="resync/test/testdata/b"))
     d = Dump()
     d.check_files(resource_list=i)
     self.assertEqual(d.total_size, 28)
예제 #4
0
 def test00_dump_creation(self):
     i = Inventory()
     i.add(
         ResourceFile('http://ex.org/a',
                      size=1,
                      file='resync/test/testdata/a'))
     i.add(
         ResourceFile('http://ex.org/b',
                      size=2,
                      file='resync/test/testdata/b'))
     d = Dump()
     d.check_files(inventory=i)
     self.assertEqual(d.total_size, 28)
예제 #5
0
 def test11_bad_size(self):
     rl = ResourceList()
     rl.add(
         Resource('http://ex.org/a', length=9999, path='tests/testdata/a'))
     d = Dump(rl)
     self.assertTrue(d.check_files(check_length=False))
     self.assertRaises(DumpError, d.check_files)
예제 #6
0
 def test02_dump_check_files(self):
     cl=ChangeList()
     cl.add( Resource('http://ex.org/a', length=7, path='resync/test/testdata/a', change="updated") )
     cl.add( Resource('http://ex.org/b', length=21, path='resync/test/testdata/b', change="updated") )
     d=Dump(resources=cl)
     self.assertTrue(d.check_files())
     self.assertEqual(d.total_size, 28)
예제 #7
0
 def test02_dump_check_files(self):
     cl = ChangeList()
     cl.add(Resource('http://ex.org/a', length=7,
                     path='tests/testdata/a', change="updated"))
     cl.add(Resource('http://ex.org/b', length=21,
                     path='tests/testdata/b', change="updated"))
     d = Dump(resources=cl)
     self.assertTrue(d.check_files())
     self.assertEqual(d.total_size, 28)
예제 #8
0
 def test11_bad_size(self):
     rl=ResourceList()
     rl.add( Resource('http://ex.org/a', length=9999, path='resync/test/testdata/a') )
     d=Dump(rl)
     self.assertTrue( d.check_files(check_length=False) )
     self.assertRaises( DumpError, d.check_files )