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
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)
def test_get_objects(self): pl = Player(u"Sven", u"Mr. Green") pl.set_objects([u"library"]) assert (u"library" in pl.get_objects())
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"])
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)