def test_noparsepeer(self): """ Ensure the result of parsed noise lines is empty """ parsed = NTPPeers.parse(noiselines) empty = NTPPeers.newpeerdict() self.assertEqual(parsed, empty)
def test_noparsestratum99(self): empty = NTPPeers.newpeerdict() parsed = NTPPeers.parse(' 1234 5678 99 u 8 128 377 31.430 -16.143 74.185') self.assertEqual(parsed, empty)
def test_parsepeer(self): parsed = NTPPeers.parse(alllines) self.assertEqual(parsed, parsedpeers)
def test_parsetestdata(self): """Ensure the test data matches the expected number of valid peers.""" for t in testdata: parsed = NTPPeers.parse(t) self.assertEqual(len(parsed['all']['address']), testdata[t])
def test_parsepeer(self): """Ensure the parsed peer lines matches the expected values.""" parsed = NTPPeers.parse(alllines) self.assertEqual(parsed, parsedpeers)
def test_noparsestratum99(self): """Ensure the result of parsed incorrect peer line is empty.""" empty = NTPPeers.newpeerdict() parsed = NTPPeers.parse( ' 1234 5678 99 u 8 128 377 31.430 -16.143 74.185') self.assertEqual(parsed, empty)
def test_noparsestratum99(self): empty = NTPPeers.newpeerdict() parsed = NTPPeers.parse( ' 1234 5678 99 u 8 128 377 31.430 -16.143 74.185') self.assertEqual(parsed, empty)
def test_noparsestratum99(self): """Ensure the result of parsed incorrect peer line is empty.""" empty = NTPPeers.newpeerdict() parsed = NTPPeers.parse(' 1234 5678 99 u 8 128 377 31.430 -16.143 74.185') self.assertEqual(parsed, empty)