From 3f7234bfd3803fd0525b5d215ea952319e86a6d8 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Fri, 18 Aug 2023 08:18:26 -0700 Subject: [PATCH] Move sources tests into correct class --- tests/test_octodns_provider_yaml.py | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/test_octodns_provider_yaml.py b/tests/test_octodns_provider_yaml.py index 4fabb54..37df75d 100644 --- a/tests/test_octodns_provider_yaml.py +++ b/tests/test_octodns_provider_yaml.py @@ -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',