Ejemplo n.º 1
0
 def test_bad_trace(self):
     check = CheckNTPMon()
     self.assertEqual(check.trace(''), 1, 'Invalid trace not detected')
     self.assertEqual(check.trace('    '), 1, 'Invalid trace not detected')
     self.assertEqual(check.trace('!@#$%^&*()'), 1,
                      'Invalid trace not detected')
     self.assertEqual(check.trace('blah.example.com'), 1,
                      'Invalid trace not detected')
Ejemplo n.º 2
0
    def test_bad_trace_demos(self):
        """Ensure that bad demo traces produce errors."""
        check = CheckNTPMon()
#        for d in demodata:
#            self.assertEqual(check.trace(d.split("\n")), 2, 'Demo data not detected as bad trace')
        for d in baddemotrace:
            self.assertEqual(check.trace(d.split("\n")), 2, 'Invalid trace not detected')
Ejemplo n.º 3
0
 def test_bad_trace_demos(self):
     """Ensure that bad demo traces produce errors."""
     check = CheckNTPMon()
     #        for d in demodata:
     #            self.assertEqual(check.trace(d.split("\n")), 2, 'Demo data not detected as bad trace')
     for d in baddemotrace:
         self.assertEqual(check.trace(d.split("\n")), 2,
                          'Invalid trace not detected')
Ejemplo n.º 4
0
 def test_trace_demos(self):
     """Ensure that demo traces are parsed successfully and don't produce exceptions or unknown results."""
     for d in demotrace:
         check = CheckNTPMon()
         self.assertEqual(check.trace(d.split("\n")), 0, 'Error parsing demo trace data')
Ejemplo n.º 5
0
 def test_bad_trace(self):
     check = CheckNTPMon()
     self.assertEqual(check.trace(''), 1, 'Invalid trace not detected')
     self.assertEqual(check.trace('    '), 1, 'Invalid trace not detected')
     self.assertEqual(check.trace('!@#$%^&*()'), 1, 'Invalid trace not detected')
     self.assertEqual(check.trace('blah.example.com'), 1, 'Invalid trace not detected')
Ejemplo n.º 6
0
 def test_trace_demos(self):
     """Ensure that demo traces are parsed successfully and don't produce exceptions or unknown results."""
     for d in demotrace:
         check = CheckNTPMon()
         self.assertEqual(check.trace(d.split("\n")), 0,
                          'Error parsing demo trace data')