Exemplo n.º 1
0
def test_find_sets():
    """Test solver (Exercise 3b)."""
    cards = numpy.array([[1, 1, 1, 2, 0], [0, 1, 2, 2, 2], [0, 1, 2, 2, 2],
                         [0, 1, 2, 2, 2]])

    set_indices = set_solver.find_sets(cards)
    assert len(set_indices) == 2
    assert (0, 1, 2) in set_indices
    assert (2, 3, 4) in set_indices
    def test_find_sets(self):
        """Test solver (Exercise 3b)."""
        cards = numpy.array([[1, 1, 1, 2, 0], [0, 1, 2, 2, 2], [0, 1, 2, 2, 2],
                             [0, 1, 2, 2, 2]])

        set_indices = set_solver.find_sets(cards)
        self.assertEqual(len(set_indices), 2)
        self.assertTrue((0, 1, 2) in set_indices)
        self.assertTrue((2, 3, 4) in set_indices)
Exemplo n.º 3
0
def test_find_sets():
    """Test solver (Exercise 3b)."""
    cards = numpy.array([[1,1,1,2,0],
                         [0,1,2,2,2],
                         [0,1,2,2,2],
                         [0,1,2,2,2]])

    set_indices = set_solver.find_sets(cards)
    assert len(set_indices) == 2
    assert (0, 1, 2) in set_indices
    assert (2, 3, 4) in set_indices
Exemplo n.º 4
0
    def test_find_sets(self):
        """Test solver (Exercise 3b)."""
        cards = numpy.array([[1,1,1,2,0],
                             [0,1,2,2,2],
                             [0,1,2,2,2],
                             [0,1,2,2,2]])

        set_indices = set_solver.find_sets(cards)
        self.assertEqual(len(set_indices), 2)
        self.assertTrue((0, 1, 2) in set_indices)
        self.assertTrue((2, 3, 4) in set_indices)