Skip to content

Commit

Permalink
Cosmetic changes in plot_object and PlotUploader.
Browse files Browse the repository at this point in the history
  • Loading branch information
Karan Desai committed Jun 21, 2016
1 parent e428796 commit 027d8d1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
4 changes: 1 addition & 3 deletions tardis/tests/tests_slow/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ def pytest_runtest_makereport(item, call):

@pytest.fixture(scope="function")
def plot_object(request):
plot_obj = PlotUploader(request)
setattr(request.node, "plot_obj", plot_obj)
return plot_obj
return PlotUploader(request)


@pytest.fixture(scope="session")
Expand Down
25 changes: 16 additions & 9 deletions tardis/tests/tests_slow/plot_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
import tardis


thumbnail_html = """
<div class="image" style="float: left">
<a href="#">
<img src= "{dokuwiki_url}lib/exe/fetch.php?media=plots:{githash}_{name}.png" />
</a>
</div>
"""


class PlotUploader(object):
def __init__(self, request):
self.request = request
Expand Down Expand Up @@ -39,15 +48,13 @@ def upload(self, report):
plot_file.name
)

thumbnail_html = """
<div class="image" style="float: left">
<a href="#">
<img src= "{0}lib/exe/fetch.php?media=plots:{1}_{2}.png" />
</a>
</div>
""".format(self.dokuwiki_url, tardis.__githash__[0:7], name)

self.plot_html.append(extras.html(thumbnail_html))
self.plot_html.append(extras.html(
thumbnail_html.format(
dokuwiki_url=self.dokuwiki_url,
githash=tardis.__githash__[0:7],
name=name)
)
)
plot_file.close()

def get_extras(self):
Expand Down

0 comments on commit 027d8d1

Please sign in to comment.