Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
20DM committed Mar 7, 2024
1 parent 70e7908 commit 8071515
Show file tree
Hide file tree
Showing 4 changed files with 18,477 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hepdata_converter/testsuite/test_yodawriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,16 @@ def test_parse_no_dependent(self, yaml_simple_path, yoda_template):
with open(output_file_path, 'r') as f:
self.assertMultiLineAlmostEqual(f, yoda_template)

@insert_path('yaml_inf')
@insert_data_as_file('yoda/with_overflows.yoda')
def test_parse_no_dependent(self, yaml_simple_path, yoda_template):
output_file_path = os.path.join(self.current_tmp, 'datafile.yoda')
hepdata_converter.convert(yaml_simple_path, output_file_path,
options={'output_format': 'yoda',
'validator_schema_version': '0.1.0',
'rivet_analysis_name': 'OVERFLOW_TEST'})

self.assertNotEqual(os.stat(output_file_path).st_size, 0, 'output yoda file is empty')
with open(output_file_path, 'r') as f:
self.assertMultiLineAlmostEqual(f, yoda_template)

Loading

0 comments on commit 8071515

Please sign in to comment.