Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include case insensitive asserts #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions test_DynamicArpaDns.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def get_arpa_ip(self, qname, qtype="PTR"):
def assertArpa(self, expected, arpa):
self.assertEqual(ip_address(expected), self.get_arpa_ip(arpa))

def test_caseInsensitiveMatchSuffix(self):
q = DNSRecord.question("test.example.Com", "ANY")
self.assertTrue(q.q.qname.matchSuffix("example.Com"))
self.assertTrue(q.q.qname.matchSuffix("example.com"))

def test_arpa(self):
# long v6 address
self.assertArpa(
Expand All @@ -40,6 +45,13 @@ def test_arpa(self):
self.assertArpa("192.0.2.3", "3.2.0.192.in-addr.arpa.")
# invalid
self.assertEqual(None, self.get_arpa_ip("x.arpa."))
# missmatch v6 case
self.assertArpa(
"2001:8bd:6::1",
"1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.0.0.0.d.b.8.0.1.0.0.2.Ip6.ARpa.",
)
# missmatch v4 case
self.assertArpa("192.0.2.3", "3.2.0.192.in-addR.arPa.")

# Test convert to and from arpa both v4 and v6
# Test non correct number of parts for v4 and v6