Ejemplo n.º 1
0
 def set_table(self, table, rules):
     table.rules = rules
     table.stock = Stock(self._deck)
     table.stock.shuffle()
     table.waste = Waste()
     table.upcard = table.stock.fetch()
     table.rule = rules.get_rule(table.upcard)
Ejemplo n.º 2
0
def test_fetch_card_from_empty_stock_raises():
    with pytest.raises(exc.NoCardsLeft):
        Stock().fetch()
Ejemplo n.º 3
0
def test_fetch_card_from_stock_returns_and_removes_it():
    card = Card(None, None)
    stock = Stock(card)
    assert stock.fetch() == card
    assert not stock
Ejemplo n.º 4
0
def test_non_empty_stock():
    assert Stock([0])
Ejemplo n.º 5
0
def test_empty_stock():
    assert not Stock()