def test_log_html(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    with patch('polyaxon.tracking.run.Run._log_has_events') as log_html:
        self.run.log_html(name='my_div', html='<div>test<div/>', step=1)
    assert (log_html.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.HTML)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.HTML, name='my_div')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='html', name='my_div', data=events_file)
    assert (len(results.df.values) == 1)
def test_log_html(self):
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    with patch('polyaxon.tracking.run.Run._log_has_events') as log_html:
        self.run.log_html(name='my_div', html='<div>test<div/>', step=1)
    assert (log_html.call_count == 1)
    self.event_logger.flush()
    assert (os.path.exists(get_asset_path(self.run_path, kind=V1ArtifactKind.HTML)) is False)
    assert (os.path.exists(get_event_path(self.run_path, kind=V1ArtifactKind.HTML)) is True)
    events_file = get_event_path(self.run_path, kind=V1ArtifactKind.HTML, name='my_div')
    assert (os.path.exists(events_file) is True)
    results = V1Events.read(kind='html', name='my_div', data=events_file)
    assert (len(results.df.values) == 1)