예제 #1
0
    def testValidateOIDForGlob(self):
        filter = TrapFilter()
        results = filter._validateOID("*")
        self.assertEquals(results, None)

        results = filter._validateOID("1.2.*")
        self.assertEquals(results, None)
예제 #2
0
    def testValidateOIDForGlob(self):
        filter = TrapFilter()
        results = filter._validateOID("*")
        self.assertEquals(results, None)

        results = filter._validateOID("1.2.*")
        self.assertEquals(results, None)
예제 #3
0
    def testValidateOIDFailsForInvalidGlobbing(self):
        filter = TrapFilter()
        results = filter._validateOID("1.2.3.*.5.*")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("1.*.5")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("1.5*")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.1")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.*")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("5*")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*5")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID(".*")
        self.assertEquals(results, "When using '*', only a single '*' at the end of OID is allowed")
예제 #4
0
    def testValidateOIDFailsForInvalidGlobbing(self):
        filter = TrapFilter()
        results = filter._validateOID("1.2.3.*.5.*")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("1.*.5")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("1.5*")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.1")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*.*")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("5*")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID("*5")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")

        results = filter._validateOID(".*")
        self.assertEquals(
            results,
            "When using '*', only a single '*' at the end of OID is allowed")
예제 #5
0
 def testValidateOIDFailsForDoubleDots(self):
     filter = TrapFilter()
     results = filter._validateOID("1.2..3")
     self.assertEquals(results, "Consecutive '.'s not allowed")
예제 #6
0
 def testValidateOIDFailsForInvalidChars(self):
     filter = TrapFilter()
     results = filter._validateOID("1.2.3-5.*")
     self.assertEquals(results, "Invalid character found; only digits, '.' and '*' allowed")
예제 #7
0
 def testValidateOIDFailsForSimpleNumber(self):
     filter = TrapFilter()
     results = filter._validateOID("123")
     self.assertEquals(results, "At least one '.' required")
예제 #8
0
 def testValidateOIDFailsForEmptyString(self):
     filter = TrapFilter()
     results = filter._validateOID("")
     self.assertEquals(results, "Empty OID is invalid")
예제 #9
0
 def testValidateOIDFailsForDoubleDots(self):
     filter = TrapFilter()
     results = filter._validateOID("1.2..3")
     self.assertEquals(results, "Consecutive '.'s not allowed")
예제 #10
0
 def testValidateOIDFailsForInvalidChars(self):
     filter = TrapFilter()
     results = filter._validateOID("1.2.3-5.*")
     self.assertEquals(
         results,
         "Invalid character found; only digits, '.' and '*' allowed")
예제 #11
0
 def testValidateOIDFailsForSimpleNumber(self):
     filter = TrapFilter()
     results = filter._validateOID("123")
     self.assertEquals(results, "At least one '.' required")
예제 #12
0
 def testValidateOIDFailsForEmptyString(self):
     filter = TrapFilter()
     results = filter._validateOID("")
     self.assertEquals(results, "Empty OID is invalid")