Update Edge DNS tests and fixtures for NULL SRV records

Thanks to @jdgri for assisting with API tests to confirm support
This commit is contained in:
Mark Tearle
2021-01-15 18:32:11 +08:00
parent fb197b890e
commit e0d79f826f
2 changed files with 23 additions and 7 deletions
+18 -2
View File
@@ -9,6 +9,22 @@
"name": "_srv._tcp.unit.tests",
"ttl": 600
},
{
"rdata": [
"0 0 0 ."
],
"type": "SRV",
"name": "_imap._tcp.unit.tests",
"ttl": 600
},
{
"rdata": [
"0 0 0 ."
],
"type": "SRV",
"name": "_pop3._tcp.unit.tests",
"ttl": 600
},
{
"rdata": [
"2601:644:500:e210:62f8:1dff:feb8:947a"
@@ -151,7 +167,7 @@
}
],
"metadata": {
"totalElements": 16,
"totalElements": 18,
"showAll": true
}
}
}
+5 -5
View File
@@ -77,14 +77,14 @@ class TestEdgeDnsProvider(TestCase):
zone = Zone('unit.tests.', [])
provider.populate(zone)
self.assertEquals(16, len(zone.records))
self.assertEquals(18, len(zone.records))
changes = self.expected.changes(zone, provider)
self.assertEquals(0, len(changes))
# 2nd populate makes no network calls/all from cache
again = Zone('unit.tests.', [])
provider.populate(again)
self.assertEquals(16, len(again.records))
self.assertEquals(18, len(again.records))
# bust the cache
del provider._zone_records[zone.name]
@@ -105,7 +105,7 @@ class TestEdgeDnsProvider(TestCase):
mock.delete(ANY, status_code=204)
changes = provider.apply(plan)
self.assertEquals(29, changes)
self.assertEquals(31, changes)
# Test against a zone that doesn't exist yet
with requests_mock() as mock:
@@ -118,7 +118,7 @@ class TestEdgeDnsProvider(TestCase):
mock.delete(ANY, status_code=204)
changes = provider.apply(plan)
self.assertEquals(14, changes)
self.assertEquals(16, changes)
# Test against a zone that doesn't exist yet, but gid not provided
with requests_mock() as mock:
@@ -132,7 +132,7 @@ class TestEdgeDnsProvider(TestCase):
mock.delete(ANY, status_code=204)
changes = provider.apply(plan)
self.assertEquals(14, changes)
self.assertEquals(16, changes)
# Test against a zone that doesn't exist, but cid not provided