Exemplo n.º 1
0
    def test_multiple_value_setter_fail(self):
        first_value = 1
        unknown_value = 9
        values = [first_value, 2, 3]
        exposed = True

        card = Card(_, values, _, exposed)
        with self.assertRaises(RuntimeError):
            card.value = unknown_value
Exemplo n.º 2
0
    def test_value_setter(self):
        initial_value = 1
        another_value = 2
        values = [initial_value]
        exposed = True

        card = Card(_, values, _, exposed)
        card.value = another_value

        self.assertEqual(card.value, another_value)
Exemplo n.º 3
0
    def test_multiple_value_setter(self):
        first_value = 1
        second_value = 2
        values = [first_value, second_value, 3]
        exposed = True

        card = Card(_, values, _, exposed)
        card.value = second_value

        self.assertEqual(card.value, second_value)
Exemplo n.º 4
0
    def test_card_multiple_values(self):
        first_value = 1
        values = [first_value, 2, 3]
        exposed = True

        card = Card(_, values, _, exposed)

        self.assertIsNone(card.value)
        self.assertEqual(card.possible_values, values)
        self.assertTrue(str(value) in str(card) for value in values)

        card.value = first_value
        self.assertEqual(card.value, first_value)