def test_log_artifact(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    tsv_file = (tempfile.mkdtemp() + '/file.tsv')
    self.touch(tsv_file)
    with patch('polyaxon.tracking.run.Run.log_artifact_ref') as log_artifact:
        self.run.log_artifact(name='file', path=tsv_file, kind=V1ArtifactKind.TSV, versioned=False)
    assert (log_artifact.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(self.run.get_outputs_path('file.tsv')) is True)
def test_log_artifact(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    tsv_file = (tempfile.mkdtemp() + '/file.tsv')
    self.touch(tsv_file)
    with patch('polyaxon.tracking.run.Run.log_artifact_ref') as log_artifact:
        self.run.log_artifact(name='file', path=tsv_file, kind=V1ArtifactKind.TSV, versioned=False)
    assert (log_artifact.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.TSV)) is False)
    assert (os.path.exists(self.run.get_outputs_path('file.tsv')) is True)