Esempio n. 1
0
 def test_invalid(self, monkeypatch):
     c = Character()
     monkeypatch.setattr("builtins.input", lambda x: "123")
     with pytest.raises(ValueError) as excinfo:
         c.char_gender()
     exception_msg = excinfo.value.args[0]
     assert exception_msg == "Invalid selection"
Esempio n. 2
0
 def test_female_word(self, monkeypatch):
     c = Character()
     monkeypatch.setattr("builtins.input", lambda x: "female")
     c.char_gender()
     assert c.gender == "Female"
Esempio n. 3
0
 def test_male_letter(self, monkeypatch):
     c = Character()
     monkeypatch.setattr("builtins.input", lambda x: "m")
     c.char_gender()
     assert c.gender == "Male"