示例#1
0
def matchBuildID(ruleBuildID, queryBuildID):
    """Decides whether a buildID from the rules matches an incoming one.
       If the ruleBuildID is null, we match any queryBuildID. If it's not
       null, we must either match exactly, or match with a camparison
       operator."""
    if ruleBuildID is None:
        return True
    return string_compare(queryBuildID, ruleBuildID)
示例#2
0
def matchBuildID(ruleBuildID, queryBuildID):
    """Decides whether a buildID from the rules matches an incoming one.
       If the ruleBuildID is null, we match any queryBuildID. If it's not
       null, we must either match exactly, or match with a camparison
       operator."""
    if ruleBuildID is None:
        return True
    return string_compare(queryBuildID, ruleBuildID)
示例#3
0
 def test_lesser_or_equal(self):
     self.assertTrue(string_compare('20150314092652', '<=20150314092653'))
     self.assertTrue(string_compare('20150314092653', '<=20150314092653'))
     self.assertFalse(string_compare('20150314092654', '<=20150314092653'))
示例#4
0
 def test_less_than(self):
     self.assertTrue(string_compare('20150314092652', '<20150314092653'))
     self.assertFalse(string_compare('20150314092653', '<20150314092653'))
     self.assertFalse(string_compare('20150314092654', '<20150314092653'))
示例#5
0
 def test_greater_than(self):
     self.assertFalse(string_compare('20150314092652', '>20150314092653'))
     self.assertFalse(string_compare('20150314092653', '>20150314092653'))
     self.assertTrue(string_compare('20150314092654', '>20150314092653'))
示例#6
0
 def test_equality(self):
     self.assertTrue(string_compare('20150314092653', '20150314092653'))
     self.assertFalse(string_compare('20010100000000', '20150314092653'))
示例#7
0
 def test_lesser_or_equal(self):
     self.assertTrue(string_compare('20150314092652', '<=20150314092653'))
     self.assertTrue(string_compare('20150314092653', '<=20150314092653'))
     self.assertFalse(string_compare('20150314092654', '<=20150314092653'))
示例#8
0
 def test_less_than(self):
     self.assertTrue(string_compare('20150314092652', '<20150314092653'))
     self.assertFalse(string_compare('20150314092653', '<20150314092653'))
     self.assertFalse(string_compare('20150314092654', '<20150314092653'))
示例#9
0
 def test_greater_than(self):
     self.assertFalse(string_compare('20150314092652', '>20150314092653'))
     self.assertFalse(string_compare('20150314092653', '>20150314092653'))
     self.assertTrue(string_compare('20150314092654', '>20150314092653'))
示例#10
0
 def test_equality(self):
     self.assertTrue(string_compare('20150314092653', '20150314092653'))
     self.assertFalse(string_compare('20010100000000', '20150314092653'))