mirror of
https://github.com/github/octodns.git
synced 2024-05-11 05:55:00 +00:00
Move sources tests into correct class
This commit is contained in:
@@ -389,29 +389,6 @@ xn--dj-kia8a:
|
||||
list(provider.list_zones()),
|
||||
)
|
||||
|
||||
|
||||
class TestSplitYamlProvider(TestCase):
|
||||
def test_list_all_yaml_files(self):
|
||||
yaml_files = ('foo.yaml', '1.yaml', '$unit.tests.yaml')
|
||||
all_files = ('something', 'else', '1', '$$', '-f') + yaml_files
|
||||
all_dirs = ('dir1', 'dir2/sub', 'tricky.yaml')
|
||||
|
||||
with TemporaryDirectory() as td:
|
||||
directory = join(td.dirname)
|
||||
|
||||
# Create some files, some of them with a .yaml extension, all of
|
||||
# them empty.
|
||||
for emptyfile in all_files:
|
||||
touch(join(directory, emptyfile))
|
||||
# Do the same for some fake directories
|
||||
for emptydir in all_dirs:
|
||||
makedirs(join(directory, emptydir))
|
||||
|
||||
# This isn't great, but given the variable nature of the temp dir
|
||||
# names, it's necessary.
|
||||
d = [join(directory, f) for f in yaml_files]
|
||||
self.assertEqual(len(yaml_files), len(d))
|
||||
|
||||
def test_split_sources(self):
|
||||
with TemporaryDirectory() as td:
|
||||
directory = join(td.dirname)
|
||||
@@ -481,6 +458,29 @@ class TestSplitYamlProvider(TestCase):
|
||||
# make sure that we get the idna one back
|
||||
self.assertEqual(idna, provider._zone_sources(zone))
|
||||
|
||||
|
||||
class TestSplitYamlProvider(TestCase):
|
||||
def test_list_all_yaml_files(self):
|
||||
yaml_files = ('foo.yaml', '1.yaml', '$unit.tests.yaml')
|
||||
all_files = ('something', 'else', '1', '$$', '-f') + yaml_files
|
||||
all_dirs = ('dir1', 'dir2/sub', 'tricky.yaml')
|
||||
|
||||
with TemporaryDirectory() as td:
|
||||
directory = join(td.dirname)
|
||||
|
||||
# Create some files, some of them with a .yaml extension, all of
|
||||
# them empty.
|
||||
for emptyfile in all_files:
|
||||
touch(join(directory, emptyfile))
|
||||
# Do the same for some fake directories
|
||||
for emptydir in all_dirs:
|
||||
makedirs(join(directory, emptydir))
|
||||
|
||||
# This isn't great, but given the variable nature of the temp dir
|
||||
# names, it's necessary.
|
||||
d = [join(directory, f) for f in yaml_files]
|
||||
self.assertEqual(len(yaml_files), len(d))
|
||||
|
||||
def test_provider(self):
|
||||
source = SplitYamlProvider(
|
||||
'test',
|
||||
|
||||
Reference in New Issue
Block a user