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

Avoid . on the end of files, but still test axfr default

This commit is contained in:
Ross McFarland
2021-01-25 15:45:23 -08:00
parent c08d4ac88f
commit ea943e606e
5 changed files with 13 additions and 3 deletions

3
.gitignore vendored
View File

@@ -5,8 +5,8 @@
*.pyc
.coverage
.env
/config/
/build/
/config/
coverage.xml
dist/
env/
@@ -14,4 +14,5 @@ htmlcov/
nosetests.xml
octodns.egg-info/
output/
tests/zones/unit.tests.
tmp/

View File

@@ -9,6 +9,7 @@ import dns.zone
from dns.exception import DNSException
from mock import patch
from shutil import copyfile
from six import text_type
from unittest import TestCase
@@ -21,7 +22,7 @@ from octodns.record import ValidationError
class TestAxfrSource(TestCase):
source = AxfrSource('test', 'localhost')
forward_zonefile = dns.zone.from_file('./tests/zones/unit.tests.',
forward_zonefile = dns.zone.from_file('./tests/zones/unit.tests.tst',
'unit.tests', relativize=False)
@patch('dns.zone.from_xfr')
@@ -44,7 +45,7 @@ class TestAxfrSource(TestCase):
class TestZoneFileSource(TestCase):
source = ZoneFileSource('test', './tests/zones')
source = ZoneFileSource('test', './tests/zones', file_extension='tst')
def test_zonefiles_with_extension(self):
source = ZoneFileSource('test', './tests/zones', 'extension')
@@ -53,6 +54,14 @@ class TestZoneFileSource(TestCase):
source.populate(valid)
self.assertEquals(1, len(valid.records))
def test_zonefiles_without_extension(self):
copyfile('./tests/zones/unit.tests.tst', './tests/zones/unit.tests.')
source = ZoneFileSource('test', './tests/zones')
# Load zonefiles without a specified file extension
valid = Zone('unit.tests.', [])
source.populate(valid)
self.assertEquals(12, len(valid.records))
def test_populate(self):
# Valid zone file in directory
valid = Zone('unit.tests.', [])