def testValidateOIDForGlob(self): filter = TrapFilter() results = filter._validateOID("*") self.assertEquals(results, None) results = filter._validateOID("1.2.*") self.assertEquals(results, None)
def testValidateOIDForGlob(self): filter = TrapFilter() results = filter._validateOID("*") self.assertEquals(results, None) results = filter._validateOID("1.2.*") self.assertEquals(results, None)
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")
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")
def testValidateOIDFailsForDoubleDots(self): filter = TrapFilter() results = filter._validateOID("1.2..3") self.assertEquals(results, "Consecutive '.'s not allowed")
def testValidateOIDFailsForInvalidChars(self): filter = TrapFilter() results = filter._validateOID("1.2.3-5.*") self.assertEquals(results, "Invalid character found; only digits, '.' and '*' allowed")
def testValidateOIDFailsForSimpleNumber(self): filter = TrapFilter() results = filter._validateOID("123") self.assertEquals(results, "At least one '.' required")
def testValidateOIDFailsForEmptyString(self): filter = TrapFilter() results = filter._validateOID("") self.assertEquals(results, "Empty OID is invalid")
def testValidateOIDFailsForDoubleDots(self): filter = TrapFilter() results = filter._validateOID("1.2..3") self.assertEquals(results, "Consecutive '.'s not allowed")
def testValidateOIDFailsForInvalidChars(self): filter = TrapFilter() results = filter._validateOID("1.2.3-5.*") self.assertEquals( results, "Invalid character found; only digits, '.' and '*' allowed")
def testValidateOIDFailsForSimpleNumber(self): filter = TrapFilter() results = filter._validateOID("123") self.assertEquals(results, "At least one '.' required")
def testValidateOIDFailsForEmptyString(self): filter = TrapFilter() results = filter._validateOID("") self.assertEquals(results, "Empty OID is invalid")