def test_missing_required_token(self): with pytest.raises(SolvingError) as exception: n.solve(category='natural', function='key', digits=1, type='lighting') assert str(exception.value).startswith("Token") is True
def test_implicit(self): name = 'natural_custom_chars_001_ANI' solved = n.solve('chars', 1, type='animation') assert solved == name name = 'natural_custom_chars_001_LGT' solved = n.solve('chars', 1) assert solved == name
def test_no_match_for_token(self): with pytest.raises(TokenError) as exception: n.solve(category='natural', function='sarasa', whatAffects='chars', digits=1, type='lighting') assert str(exception.value).startswith("name") is True
def test_defaults(self): name = 'natural_custom_chars_001_LGT' solved = n.solve(category='natural', whatAffects='chars', digits=1, type='lighting') assert solved == name name = 'natural_custom_chars_001_LGT' solved = n.solve(whatAffects='chars', digits=1) assert solved == name
def test_solve_repeated_missing_some(self): name = "C-FRONT_C-PAROT_R-RETMAND" result = n.solve(side1="center", side3="right", region2="parotidmasseter", region3="retromandibularfossa") assert result == name
def test_explicit(self): name = 'natural_ambient_chars_001_LGT' solved = n.solve(category='natural', function='ambient', whatAffects='chars', digits=1, type='lighting') assert solved == name
def test_solve_anchoring_start(self): rules.reset_rules() rules.add_rule('anchoring', '{awesometoken}_crazy_hardcoded_value', rules.Rule.ANCHOR_START) name = 'hello_crazy_hardcoded_value' solved = n.solve(awesometoken='hello') assert solved == name
def test_solve_anchoring_end(self): rules.reset_rules() rules.add_rule('anchoring', 'crazy_hardcoded_value_{awesometoken}', rules.Rule.ANCHOR_END) name = 'crazy_hardcoded_value_bye' solved = n.solve('bye') assert solved == name
def test_solve_repeat_one_token(self): name = "L-MENT_L-PAROT_L-RETMAND" result = n.solve(side="left", region1="mental", region2="parotidmasseter", region3="retromandibularfossa") assert result == name
def test_explicit_solve(self): name = 'natural_ambient_chars_024_LGT' solved = n.solve(category='natural', function='ambient', whatAffects='chars', number=24, type='lighting') assert solved == name
def test_solve_anchoring_both(self): rules.reset_rules() rules.add_rule('anchoring', '{awesometoken}_crazy_hardcoded_value_{awesometoken}', rules.Rule.ANCHOR_BOTH) name = 'hello_crazy_hardcoded_value_bye' solved = n.solve(awesometoken1='hello', awesometoken2='bye') assert solved == name
def test_solve_repeated_tokens(self): name = "C-MENT_L-PAROT_R-RETMAND" result = n.solve(side1="center", side2="left", side3="right", region1="mental", region2="parotidmasseter", region3="retromandibularfossa") assert result == name
def test_missing_not_required_token(self): with pytest.raises(SolvingError) as exception: n.solve('chars') assert str( exception.value).startswith("Missing argument for field") is True
def test_prefix_suffix_padding_solve(self): name = 'natural_custom_chars_v0032rt_LGT' tokens.remove_token('number') tokens.add_token_number('number', prefix='v', suffix='rt', padding=4) solved = n.solve('chars', 32) assert solved == name
def test_implicit_solve(self): name = 'natural_custom_chars_032_LGT' solved = n.solve('chars', 32) assert solved == name