Example #1
0
 def testEqualWithVariableDifferentValueNegative(self):
     variable1 = ConstantBuilder().value(3.0).build()
     variable2 = Mock()
     variable2.value = 3.1
     variable2.dispatch = Mock(
         side_effect=lambda x: x.visit_variable(variable2))
     self.assertFalse(variable1.equal(variable2))
     self.assertNotEqual(variable1, variable2)
Example #2
0
 def testClon(self):
     variable1 = ConstantBuilder().build()
     variable2 = variable1.clon()
     self.assertFalse(variable1 is variable2)
     self.assertTrue(variable1.equal(variable2))
Example #3
0
 def testEqualWithConstantNegative(self):
     variable1 = ConstantBuilder().value(3.0).build()
     variable2 = ConstantBuilder().value(3.1).build()
     self.assertFalse(variable1.equal(variable2))
     self.assertNotEqual(variable1, variable2)
Example #4
0
 def testEqualWithConstantPositive(self):
     variable1 = ConstantBuilder().value(3.0).build()
     variable2 = ConstantBuilder().value(3.0).build()
     self.assertTrue(variable1.equal(variable2))
     self.assertEqual(variable1, variable2)