def test_snapshot(self): '''Test a game state snapshot''' g = Game.Game(Me({'White'}), [Player("Foo", 17)]) g2 = g.snapshot() t = Cards.Triple('White', 'Rope', 'Hall') g.me.ask(t) g.others[0].show(t) assert not g2.me.asked assert not g2.others[0].shown
def test_invalid_person(self): with pytest.raises(Cards.InvalidTriple): Cards.Triple('Invalid', 'Rope', 'Hall')
def test_all_cards(self): t = Cards.Triple('Green', 'Rope', 'Hall') assert t.all_cards == ['Green', 'Rope', 'Hall']
def test_repr(self): t = Cards.Triple('Green', 'Rope', 'Hall') assert repr(t) == "Triple('Green', 'Rope', 'Hall')"
def test_room(self): t = Cards.Triple('Green', 'Rope', 'Hall') assert t.room == 'Hall'
def test_weapon(self): t = Cards.Triple('Green', 'Rope', 'Hall') assert t.weapon == 'Rope'
def test_person(self): t = Cards.Triple('Green', 'Rope', 'Hall') assert t.person == 'Green'
def test_invalid_room(self): with pytest.raises(Cards.InvalidTriple): Cards.Triple('Green', 'Rope', 'Invalid')
def test_invalid_weapon(self): with pytest.raises(Cards.InvalidTriple): Cards.Triple('Green', 'Invalid', 'Hall')