def test_log_single_metric(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    with patch('polyaxon.tracking.run.Run._log_has_metrics') as log_metrics:
        self.run.log_metrics(step=1, metric1=1.1)
    assert (log_metrics.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.METRIC)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.METRIC, name='metric1')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='metric', name='metric1', data=events_file)
    assert (len(results.df.values) == 1)
def test_log_single_metric(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    with patch('polyaxon.tracking.run.Run._log_has_metrics') as log_metrics:
        self.run.log_metrics(step=1, metric1=1.1)
    assert (log_metrics.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.METRIC)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.METRIC)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.METRIC, name='metric1')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='metric', name='metric1', data=events_file)
    assert (len(results.df.values) == 1)