Exemplo n.º 1
0
 def test_stream_from_backup_calls_get_archive_accessor_with_expected_params(
         self, archive_accessor_manager, archive_service):
     archive = ArchiveClient(archive_accessor_manager, archive_service)
     archive.stream_from_backup("path", "device_guid", "dest_guid",
                                "password", "encryption_key")
     archive_accessor_manager.get_archive_accessor.assert_called_once_with(
         "device_guid",
         destination_guid="dest_guid",
         private_password="******",
         encryption_key="encryption_key",
     )
Exemplo n.º 2
0
 def test_stream_from_backup_when_given_multiple_paths_calls_archive_accessor_stream_from_backup_with_expected_params(
         self, archive_accessor_manager, archive_service, archive_accessor):
     archive_accessor_manager.get_archive_accessor.return_value = archive_accessor
     archive = ArchiveClient(archive_accessor_manager, archive_service)
     archive.stream_from_backup(
         ["path/to/first/file", "path/to/second/file"],
         "device_guid",
         "dest_guid",
         "password",
         "encryption_key",
     )
     archive_accessor.stream_from_backup.assert_called_once_with(
         ["path/to/first/file", "path/to/second/file"],
         file_size_calc_timeout=10)
Exemplo n.º 3
0
 def test_stream_from_backup_calls_get_archive_accessor_with_expected_params(
         self, archive_accessor_factory, archive_service):
     archive = ArchiveClient(archive_accessor_factory, archive_service)
     archive.stream_from_backup(
         TEST_PATHS[0],
         TEST_DEVICE_GUID,
         TEST_DESTINATION_GUID_1,
         TEST_PASSWORD,
         TEST_ENCRYPTION_KEY,
     )
     archive_accessor_factory.create_archive_accessor.assert_called_once_with(
         TEST_DEVICE_GUID,
         ArchiveContentStreamer,
         destination_guid=TEST_DESTINATION_GUID_1,
         private_password=TEST_PASSWORD,
         encryption_key=TEST_ENCRYPTION_KEY,
     )
Exemplo n.º 4
0
 def test_stream_from_backup_when_given_multiple_paths_calls_archive_accessor_stream_from_backup_with_expected_params(
         self, archive_accessor_factory, archive_service,
         archive_content_streamer):
     archive_accessor_factory.create_archive_accessor.return_value = (
         archive_content_streamer)
     archive = ArchiveClient(archive_accessor_factory, archive_service)
     archive.stream_from_backup(
         TEST_PATHS,
         TEST_DEVICE_GUID,
         TEST_DESTINATION_GUID_1,
         TEST_PASSWORD,
         TEST_ENCRYPTION_KEY,
         file_size_calc_timeout=10000,
         show_deleted=True,
     )
     archive_content_streamer.stream_from_backup.assert_called_once_with(
         TEST_BACKUP_SET_ID,
         TEST_PATHS,
         file_size_calc_timeout=10000,
         show_deleted=True,
     )