Skip to content

Commit

Permalink
add a (kind of useless) test of outputting PR1
Browse files Browse the repository at this point in the history
(Just to check it actually does something instead of crashing)
  • Loading branch information
Wooble committed Aug 19, 2019
1 parent c357fcd commit 08e0f42
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pycounter/test/test_pr1.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ def test_row_metric(self):
# test metric of the second row
jan_data = next(iter(self.report.pubs[1]))
self.assertEqual(jan_data[1], "Searches-federated and automated")


def test_output(tmp_path):
report = pycounter.report.parse(
os.path.join(os.path.dirname(__file__), "data/PR1.tsv")
)
report.write_tsv(str(tmp_path / "outputfile.tsv"))
with open(str(tmp_path / "outputfile.tsv"), "rb") as new_file:
new_content = new_file.read()
assert b"Searches-federated" in new_content

0 comments on commit 08e0f42

Please sign in to comment.