Ejemplo n.º 1
0
    def test_get_variables(self):
        assignment = Assignment()
        self.assertEqual(0, len(assignment.get_variables()))

        assignment.set_assignment(self.var1, 1)
        assignment.set_assignment(self.var2, 2)
        self.assertSameElements([self.var1, self.var2], assignment.get_variables())
Ejemplo n.º 2
0
    def test_is_complete(self):
        vars = [self.var1, self.var2]
        assignment = Assignment()
        assignment.set_assignment(self.var1, 1)

        self.assertFalse(assignment.is_complete(vars))

        assignment.set_assignment(self.var2, 2)
        self.assertTrue(assignment.is_complete(vars))
Ejemplo n.º 3
0
    def test_is_complete(self):
        vars = [self.var1, self.var2]
        assignment = Assignment()
        assignment.set_assignment(self.var1, 1)

        self.assertFalse(assignment.is_complete(vars))

        assignment.set_assignment(self.var2, 2)
        self.assertTrue(assignment.is_complete(vars))
Ejemplo n.º 4
0
    def test_get_variables(self):
        assignment = Assignment()
        self.assertEqual(0, len(assignment.get_variables()))

        assignment.set_assignment(self.var1, 1)
        assignment.set_assignment(self.var2, 2)
        self.assertSameElements([self.var1, self.var2],
                                assignment.get_variables())
Ejemplo n.º 5
0
    def test_get_assignment(self):
        assignment = Assignment()
        assignment.set_assignment(self.var1, 1)

        self.assertEqual(1, assignment.get_assignment(self.var1))
        self.assertEqual(None, assignment.get_assignment(self.var2))
Ejemplo n.º 6
0
    def test_get_assignment(self):
        assignment = Assignment()
        assignment.set_assignment(self.var1, 1)

        self.assertEqual(1, assignment.get_assignment(self.var1))
        self.assertEqual(None, assignment.get_assignment(self.var2))