Exemplo n.º 1
0
 def test_two(self):
     file_a1 = File("a.txt", [FileVersion("a", "a", 100, "upload", 10)])
     file_a2 = File("b.txt", [FileVersion("b", "b", 100, "upload", 10)])
     file_a3 = File("d.txt", [FileVersion("c", "c", 100, "upload", 10)])
     file_a4 = File("f.txt", [FileVersion("f", "f", 100, "upload", 10)])
     file_b1 = File("b.txt", [FileVersion("b", "b", 200, "upload", 10)])
     file_b2 = File("e.txt", [FileVersion("e", "e", 200, "upload", 10)])
     folder_a = FakeFolder('b2', [file_a1, file_a2, file_a3, file_a4])
     folder_b = FakeFolder('b2', [file_b1, file_b2])
     self.assertEqual([(file_a1, None), (file_a2, file_b1), (file_a3, None),
                       (None, file_b2), (file_a4, None)],
                      list(zip_folders(folder_a, folder_b, self.reporter)))
Exemplo n.º 2
0
 def test_pass_reporter_to_folder(self):
     """
     Check that the zip_folders() function passes the reporter through
     to both folders.
     """
     folder_a = MagicMock()
     folder_b = MagicMock()
     folder_a.all_files = MagicMock(return_value=iter([]))
     folder_b.all_files = MagicMock(return_value=iter([]))
     self.assertEqual([],
                      list(zip_folders(folder_a, folder_b, self.reporter)))
     folder_a.all_files.assert_called_once_with(self.reporter,
                                                DEFAULT_SCAN_MANAGER)
     folder_b.all_files.assert_called_once_with(self.reporter)
Exemplo n.º 3
0
 def test_one_empty(self):
     file_a1 = File("a.txt", [FileVersion("a", "a", 100, "upload", 10)])
     folder_a = FakeFolder('b2', [file_a1])
     folder_b = FakeFolder('b2', [])
     self.assertEqual([(file_a1, None)],
                      list(zip_folders(folder_a, folder_b, self.reporter)))
Exemplo n.º 4
0
 def test_empty(self):
     folder_a = FakeFolder('b2', [])
     folder_b = FakeFolder('b2', [])
     self.assertEqual([],
                      list(zip_folders(folder_a, folder_b, self.reporter)))