def test_from_dict_error(self): d = dict( literal="pneumonia", category="CONDITION", invalid="this is an invalid key", ) with pytest.raises(ValueError): TargetRule.from_dict(d)
def test_from_dict(self): d = dict(literal="pneumonia", category="CONDITION") assert TargetRule.from_dict(d)