示例#1
0
 def test_equality(self):
     self.assertEqual(0, utils.declength_compare('abc', 'abc'))
     self.assertEqual(0, utils.declength_compare([1, 2, 3], [1, 2, 3]))
示例#2
0
 def test_not_lexical(self):
     self.assertEqual(1, utils.declength_compare('abc', 'aaaa'))
     self.assertEqual(-1, utils.declength_compare('aaaa', 'abc'))
示例#3
0
 def test_same_length(self):
     self.assertEqual(-1, utils.declength_compare('abc', 'abd'))
     self.assertEqual(1, utils.declength_compare('abe', 'abd'))
示例#4
0
 def test_reciprocity(self):
     self.assertEqual(1, utils.declength_compare('a', 'bb'))
     self.assertEqual(-1, utils.declength_compare('aa', 'b'))