diff --git a/test.py b/test.py index e731ba1..b98acd2 100644 --- a/test.py +++ b/test.py @@ -35,9 +35,11 @@ class TestProxy(unittest.TestCase): stop = await start() self.add_async_cleanup(stop) - with self.assertRaises(DnsResponseCode): + with self.assertRaises(DnsResponseCode) as cm: await resolve('www.google.com', TYPES.A) + self.assertEqual(cm.exception.args[0], 5) + @async_test async def test_e2e_match_all(self): resolve, clear_cache = get_resolver(3535) @@ -82,9 +84,11 @@ class TestProxy(unittest.TestCase): stop = await start() self.add_async_cleanup(stop) - with self.assertRaises(DnsResponseCode): + with self.assertRaises(DnsResponseCode) as cm: await resolve('www.google.com', TYPES.A) + self.assertEqual(cm.exception.args[0], 2) + @async_test async def test_e2e_default_resolver_match_none_non_existing_domain(self): resolve, clear_cache = get_resolver(53) @@ -93,9 +97,11 @@ class TestProxy(unittest.TestCase): stop = await start() self.add_async_cleanup(stop) - with self.assertRaises(DnsResponseCode): + with self.assertRaises(DnsResponseCode) as cm: await resolve('doesnotexist.charemza.name', TYPES.A) + self.assertEqual(cm.exception.args[0], 5) + def get_socket(port): def _get_socket():