コード例 #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
コード例 #2
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)
コード例 #3
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())
コード例 #4
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"])
コード例 #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)