Ejemplo n.º 1
0
 def test_find_pairs(self):
     from_to_pairs = fix.find_pairs(self.tmp_dir.name)
     from_path_parts = [
         'fakelab', 'Subjects', 'fakemouse', '1900-01-01', '002'
     ]
     self.assertTrue(
         all(x in Path(from_to_pairs[0][0]).parts for x in from_path_parts))
     to_path_parts = [
         'fakelab', 'Subjects', 'fakemouse', '1900-01-01', '001'
     ]
     self.assertTrue(
         all(x in Path(from_to_pairs[0][1]).parts for x in to_path_parts))
Ejemplo n.º 2
0
 def test_move_rename_pairs(self):
     # Test all outputs of find function
     from_to_pairs = []
     moved_ok = fix.move_rename_pairs(from_to_pairs)
     self.assertTrue(not moved_ok)
     # Bad paths
     from_to_pairs = [("bla", "ble")]
     moved_ok = fix.move_rename_pairs(from_to_pairs)
     self.assertTrue(sum(moved_ok) == 0)
     # Same as execute
     from_to_pairs = fix.find_pairs(self.tmp_dir.name)
     moved_ok = fix.move_rename_pairs(from_to_pairs)
     self.assertTrue(sum(moved_ok) == 1)
Ejemplo n.º 3
0
 def test_find_pairs(self):
     from_to_pairs = fix.find_pairs(self.tmp_dir.name)
     self.assertTrue("fakelab/Subjects/fakemouse/1900-01-01/002" in from_to_pairs[0][0])
     self.assertTrue("fakelab/Subjects/fakemouse/1900-01-01/001" in from_to_pairs[0][1])