def test_remote_os_found(self, m): headers = {"X-Distribution": "Ubuntu"} m.register_uri("GET", "http://example.com", headers=headers) resp = requests.get("http://example.com") test = FakeTestObject(resp) signal = remote_os(test) self.assertEqual("SERVER_OS_UBUNTU", signal.slug)
def test_remote_os_not_found(self, m): m.register_uri("GET", "http://example.com") resp = requests.get("http://example.com") test = FakeTestObject(resp) signal = remote_os(test) self.assertEqual("SERVER_OS_UNKNOWN", signal.slug)