Browse Source

(test) Ensure that a forbidden domain that does not exist is not proxied

main
Michal Charemza 5 years ago
parent
commit
396a1f9e90
No known key found for this signature in database GPG Key ID: 4BBAF0F6B73C4363
1 changed files with 11 additions and 0 deletions
  1. +11
    -0
      test.py

+ 11
- 0
test.py View File

@@ -73,6 +73,17 @@ class TestProxy(unittest.TestCase):
with self.assertRaises(DnsRecordDoesNotExist):
await resolve('doesnotexist.charemza.name', TYPES.A)

@async_test
async def test_e2e_default_resolver_match_none_non_existing_domain(self):
resolve, clear_cache = get_resolver(53)
self.add_async_cleanup(clear_cache)
start = DnsProxy()
stop = await start()
self.add_async_cleanup(stop)

with self.assertRaises(DnsResponseCode):
await resolve('doesnotexist.charemza.name', TYPES.A)


def get_socket(port):
def _get_socket():


Loading…
Cancel
Save