def test_show(self): p = Player.Player("Foo", 3) t = Triple('White', 'Rope', 'Hall') p.show(t) assert p.shown == [t]
def test_check_good(self): p = Player.Player("Foo", 3) p.hasCards = {'Green', 'Rope'} p.notHasCards == {'White', 'Revolver'} p.check()
def test_noshow(self): p = Player.Player("Foo", 3) t = Triple('White', 'Rope', 'Hall') p.noshow(t) assert p.notHasCards == {'White', 'Rope', 'Hall'}
def test_has_identical(self): p = Player.Player("Foo", 3) p.hasCard('Green') p.hasCard('Green') assert p.hasCards == {'Green'}
def test_ask(self): p = Player.Player("Foo", 3) t = Triple('White', 'Rope', 'Hall') p.ask(t) assert p.asked == [t]
def test_noshow_impossible(self): p = Player.Player("Foo", 3) t = Triple('White', 'Rope', 'Hall') p.hasCards = {'Rope'} with pytest.raises(ImpossibleError): p.noshow(t)
def test_check_bad(self): p = Player.Player("Foo", 3) p.hasCards = {'White', 'Rope'} p.notHasCards = {'White', 'Revolver'} with pytest.raises(ImpossibleError): p.check()
def test_has_too_many(self): p = Player.Player("Foo", 3) p.hasCard('Green') p.hasCard('Hall') p.hasCard('White') with pytest.raises(ImpossibleError): p.hasCard('Rope')
def test_repr(self): m = Player.Me(['Plum', 'Wrench', 'Hall']) assert repr(m) == "Me(['Hall', 'Plum', 'Wrench'])"
def test_dupes(self): m = Player.Me({'White', 'Green', 'Hall', 'White'}) # Two 'White' assert m.hasCards == {'White', 'Green', 'Hall'} assert m.numCards == 3 assert m.notHasCards == set(DECK).difference(m.hasCards)
def test_repr(self): p = Player.Player("Foo", 3) assert repr(p) == "Player('Foo', 3)"