From 08e0f42e6724e5b79efcf830ff31c941666ce7f8 Mon Sep 17 00:00:00 2001 From: Geoffrey Spear Date: Mon, 19 Aug 2019 15:55:23 -0400 Subject: [PATCH] add a (kind of useless) test of outputting PR1 (Just to check it actually does something instead of crashing) --- pycounter/test/test_pr1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pycounter/test/test_pr1.py b/pycounter/test/test_pr1.py index 964f1e4..6608b7b 100644 --- a/pycounter/test/test_pr1.py +++ b/pycounter/test/test_pr1.py @@ -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