Ejemplo n.º 1
0
 def get_guess(self):
     p1 = Player(u"Test1", u"Mr. Green")
     p2 = Player(u"Test2", u"Col. Mustard")
     p1.set_objects([u"wrench", u"kitchen"])
     guess_order = [p1, p2]
     gs = Guess(u"Prof. Plum", u"wrench", u"kitchen", guess_order)
     return gs
Ejemplo n.º 2
0
 def test_set_illegal_object(self):
     pl = Player(u"Sven", u"Miss Scarlett")
     with pytest.raises(ValueError):
         pl.set_objects([u"library", u"Mrs. Peacock", u"TestUser"])
Ejemplo n.º 3
0
 def test_set_has_object(self):
     pl = Player(u"Sven", u"Miss Scarlett")
     pl.set_objects([u"library", u"Mrs. Peacock"])
     assert (pl.has_object(u"library") == True)
     assert (pl.has_object(u"Miss Scarlett") == False)
Ejemplo n.º 4
0
 def test_get_objects(self):
     pl = Player(u"Sven", u"Mr. Green")
     pl.set_objects([u"library"])
     assert (u"library" in pl.get_objects())
Ejemplo n.º 5
0
 def test_set_objects(self):
     pl = Player(u"Sven", u"Miss Scarlett")
     pl.set_objects([u"library", u"Mrs. Peacock"])
     assert (u"library" in pl._objects)
     assert (u"Mrs. Peacock" in pl._objects)
Ejemplo n.º 6
0
 def test_get_names(self):
     pl = Player(u"Sven", u"Miss Scarlett")
     assert (pl.get_playername() == u"Sven")
     assert (pl.get_charactername() == u"Miss Scarlett")
Ejemplo n.º 7
0
 def test_wrong_character(self):
     with pytest.raises(ValueError):
         pl = Player(u"Sven", u"Mis Scarlett")
Ejemplo n.º 8
0
 def test_init(self):
     pl = Player(u"Sven", u"Miss Scarlett")
     assert (pl._player_name == u"Sven")
     assert (pl._character_name == u"Miss Scarlett")