Пример #1
0
    def test_build_file_index_returns_list_of_files_and_checksums(self):
	fake_files = ['file3.txt', 'file4.zip']
	mock_sums = [Mock(), Mock()]
        self.remote_driver.calculate_checksum.side_effect = mock_sums

	ret = build_file_index(fake_files, self.remote_driver)

	self.assertEqual(zip(fake_files, mock_sums), ret)
Пример #2
0
    def test_build_file_index_calculates_checksums(self):
	fake_files = ['file1.txt', 'file2.zip']

	build_file_index(fake_files, self.remote_driver)

	self.assertEqual(map(call, fake_files), self.remote_driver.calculate_checksum.mock_calls)