Ejemplo n.º 1
0
 def test_get_source_path_ignore_nonsense(self):
     # Nonsense files in sourcedir are ignored.
     bucket = Bucket(self.workdir)
     open(os.path.join(self.workdir, 'sources', 'source3'),
          'wb').write('Hi')
     open(os.path.join(self.workdir, 'sources', 'foo_3'),
          'wb').write('Hi')
     path, marker = bucket.getSourcePath(self.src_path1)
     self.assertEqual((path, marker), (None, None))
     bucket.storeResult(self.src_path1, self.result_path1)
     path, marker = bucket.getSourcePath(self.src_path1)
     self.assertEqual(marker, '1')
     return
Ejemplo n.º 2
0
 def test_get_source_path(self):
     bucket = Bucket(self.workdir)
     path, marker = bucket.getSourcePath(self.src_path1)
     self.assertEqual((path, marker), (None, None))
     bucket.storeResult(self.src_path1, self.result_path1)
     bucket.storeResult(self.src_path2, self.result_path2)
     path, marker = bucket.getSourcePath(self.src_path1)
     self.assertEqual(
         (path, marker),
         (os.path.join(self.workdir, 'sources', 'source_1'), '1')
         )
     path, marker = bucket.getSourcePath(self.src_path2)
     self.assertEqual(
         (path, marker),
         (os.path.join(self.workdir, 'sources', 'source_2'), '2')
         )
     return