Esempio n. 1
0
 def test_number_support(self):
     """Strings given as a number must be converted first into a string"""
     # When the constant is defined as a number:
     op = String(10)
     ok_(op.equals("10", None))
     # When the constant is defined as a string:
     op = String("10")
     ok_(op.equals(10, None))
     # When both are defined as numbers:
     op = String(10)
     ok_(op.equals(10, None))
Esempio n. 2
0
 def test_equality(self):
     op = String("freedomware")
     ok_(op.equals("freedomware", None))
     assert_false(op.equals(" freedomware ", None))
     assert_false(op.equals("microsoftware", None))