[Darshan-commits] [Git][darshan/darshan][master] 2 commits: TST: add test for to_json() method
Shane Snyder
xgitlab at cels.anl.gov
Tue May 11 15:38:39 CDT 2021
Shane Snyder pushed to branch master at darshan / darshan
Commits:
550f3a65 by Tyler Reddy at 2021-04-20T13:56:02-06:00
TST: add test for to_json() method
* add a regression test for the `to_json()` method
of the `DarshanReport` class, which was previously
uncovered by tests
- - - - -
457b69ce by Shane Snyder at 2021-05-11T15:37:57-05:00
Merge branch 'treddy/darshan-treddy_test_to_json' into HEAD
- - - - -
1 changed file:
- darshan-util/pydarshan/tests/test_report.py
Changes:
=====================================
darshan-util/pydarshan/tests/test_report.py
=====================================
@@ -109,3 +109,27 @@ def test_report_invalid_file(invalid_filepath):
with pytest.raises(RuntimeError, match='Failed to open file'):
darshan.DarshanReport(invalid_filepath)
+
+def test_json_fidelity():
+ # regression test for provision of appropriate
+ # data by to_json() method of DarshanReport class
+ report = darshan.DarshanReport("tests/input/sample.darshan")
+ actual_json = report.to_json()
+
+ for expected_key in ["version",
+ "metadata",
+ "job",
+ "uid",
+ "start_time",
+ "end_time",
+ "nprocs"]:
+ assert expected_key in actual_json
+
+ for expected_value in ['69615',
+ '1490000867',
+ '1490000983',
+ '2048',
+ 'lustre',
+ 'dvs',
+ 'rootfs']:
+ assert expected_value in actual_json
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/18d1054a255b2b008ba9e8c3e5d105e83b127f72...457b69ce90530f23856c22ae16fd752e1c7dc69e
--
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/-/compare/18d1054a255b2b008ba9e8c3e5d105e83b127f72...457b69ce90530f23856c22ae16fd752e1c7dc69e
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20210511/c91ea189/attachment-0001.html>
More information about the Darshan-commits
mailing list