Esempio n. 1
0
def test_faculty_repo_log_artifact_default_destination(mocker):
    mocker.patch("faculty.datasets.put")

    repo = FacultyDatasetsArtifactRepository(ARTIFACT_URI)
    repo.log_artifact("/local/file.txt")

    faculty.datasets.put.assert_called_once_with("/local/file.txt",
                                                 ARTIFACT_ROOT + "file.txt",
                                                 PROJECT_ID)
Esempio n. 2
0
def test_faculty_repo_log_artifact(mocker, slash_prefix, remote_prefix,
                                   slash_suffix):
    mocker.patch("faculty.datasets.put")

    repo = FacultyDatasetsArtifactRepository(ARTIFACT_URI)
    repo.log_artifact("/local/file.txt",
                      slash_prefix + remote_prefix + slash_suffix)

    remote_path = posixpath.join(remote_prefix, "file.txt")

    faculty.datasets.put.assert_called_once_with("/local/file.txt",
                                                 ARTIFACT_ROOT + remote_path,
                                                 PROJECT_ID)