Skip to content

Commit

Permalink
final tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
quadrismegistus committed Sep 24, 2023
1 parent e577445 commit 937ec2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tests/test_statutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ def test_get_distinctive_qual_vals():
assert_frame_equal(output2, output3)
assert len(output2)<len(output)

# Run the function
output4 = get_distinctive_qual_vals(dfL, dfR, cols=[
'member_title',
'member_nationalities',
], maxcats=2)
assert len(output4)==0




Expand Down
5 changes: 4 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,11 @@ def test_read_config_json():
d1=read_config_json(PATH_CONFIG_DEFAULT)
assert type(d1)==dict and d1
with tempfile.TemporaryDirectory() as tdir:
assert read_config_json(os.path.join(tdir,'nonexistentfile.json')) == {}
badfile = os.path.join(tdir,'badfile.json')
with open(badfile,'w') as of: of.write('gobbledygook')
try:
read_config_json(os.path.join(tdir,'nonexistentfile.json'))
read_config_json(badfile)
assert False, 'ought to throw exception for reading unknown json file'
except Exception:
assert True, 'success'

0 comments on commit 937ec2b

Please sign in to comment.