1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

ZoneFileSource: allow users to specify file extension

This commit is contained in:
Adam Smith
2021-01-08 19:36:58 -05:00
parent 97dbb6a782
commit b2eab63d54
3 changed files with 34 additions and 4 deletions

View File

@@ -45,6 +45,13 @@ class TestAxfrSource(TestCase):
class TestZoneFileSource(TestCase):
source = ZoneFileSource('test', './tests/zones')
source_extension = ZoneFileSource('test', './tests/zones', 'extension')
def test_zonefiles_with_extension(self):
# Load zonefiles with a specified file extension
valid = Zone('unit.tests.', [])
self.source_extension.populate(valid)
self.assertEquals(1, len(valid.records))
def test_populate(self):
# Valid zone file in directory

View File

@@ -0,0 +1,12 @@
$ORIGIN unit.tests.
@ 3600 IN SOA ns1.unit.tests. root.unit.tests. (
2018071501 ; Serial
3600 ; Refresh (1 hour)
600 ; Retry (10 minutes)
604800 ; Expire (1 week)
3600 ; NXDOMAIN ttl (1 hour)
)
; NS Records
@ 3600 IN NS ns1.unit.tests.
@ 3600 IN NS ns2.unit.tests.