Browse Source

Move sources tests into correct class

pull/1048/head
Ross McFarland 2 years ago
parent
commit
3f7234bfd3
No known key found for this signature in database GPG Key ID: 943B179E15D3B22A
1 changed files with 23 additions and 23 deletions
  1. +23
    -23
      tests/test_octodns_provider_yaml.py

+ 23
- 23
tests/test_octodns_provider_yaml.py View File

@ -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',


Loading…
Cancel
Save