コード例 #1
0
def assert_upload_mocks_are_correctly_called(remote_dataset: RemoteDataset,
                                             *args):
    with patch.object(UploadHandler, "_request_upload",
                      return_value=([], [])) as request_upload_mock:
        with patch.object(UploadHandler, "upload") as upload_mock:
            remote_dataset.push(*args)

            request_upload_mock.assert_called_once()
            upload_mock.assert_called_once_with(multi_threaded=True,
                                                progress_callback=None,
                                                file_upload_callback=None)
コード例 #2
0
 def raises_if_both_as_frames_and_local_files_are_given(
         remote_dataset: RemoteDataset):
     with pytest.raises(ValueError):
         remote_dataset.push([LocalFile("test.jpg")], as_frames=True)
コード例 #3
0
 def raises_with_unsupported_files(remote_dataset: RemoteDataset):
     with pytest.raises(UnsupportedFileType):
         remote_dataset.push(["test.txt"])
コード例 #4
0
 def raises_if_files_are_not_provided(remote_dataset: RemoteDataset):
     with pytest.raises(ValueError):
         remote_dataset.push(None)