def test_arp_not_collected(self, get_latest): get_latest.return_value = self.create_mock_time( tests.TestNewCamAndArpRecords.slack + 10) test = tests.TestNewCamAndArpRecords() assert isinstance(test.test_arp(), tests.TestResult)
def test_cam_collected(self, get_latest): get_latest.return_value = self.create_mock_time( tests.TestNewCamAndArpRecords.slack - 10) test = tests.TestNewCamAndArpRecords() assert test.test_cam() is None
def test_no_arp_or_cam_records(self, get_latest): get_latest.return_value = None test = tests.TestNewCamAndArpRecords() assert test.get_status() == tests.STATUS_OK
def test_none_collected(self, get_latest): get_latest.return_value = self.create_mock_time( tests.TestNewCamAndArpRecords.slack + 10) test = tests.TestNewCamAndArpRecords() assert test.get_status() == tests.STATUS_NOT_OK assert len(test.errors) == 2
def test_arp_collected(self, get_latest): get_latest.return_value = self.create_mock_time( tests.TestNewCamAndArpRecords.slack - 10) test = tests.TestNewCamAndArpRecords() self.assertIsNone(test.test_arp())
def test_both_collected(self, get_latest): get_latest.return_value = self.create_mock_time( tests.TestNewCamAndArpRecords.slack - 10) test = tests.TestNewCamAndArpRecords() self.assertEqual(test.get_status(), tests.STATUS_OK) self.assertEqual(len(test.errors), 0)