From 9717d5d928df88280c57f0b782c9cca508e2ea1f Mon Sep 17 00:00:00 2001 From: Antoine Catton Date: Tue, 30 Dec 2014 22:05:08 -0700 Subject: [PATCH] Add test case: what if there's a directory in defaults The goal of the directory name is to be before foo and bar --- cdist/test/cdist_type/__init__.py | 7 +++++++ .../__directory_in_default/parameter/default/a/.gitkeep | 0 .../fixtures/__directory_in_default/parameter/default/bar | 0 .../fixtures/__directory_in_default/parameter/default/foo | 0 .../fixtures/__directory_in_default/parameter/optional | 2 ++ 5 files changed, 9 insertions(+) create mode 100644 cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/a/.gitkeep create mode 100644 cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/bar create mode 100644 cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/foo create mode 100644 cdist/test/cdist_type/fixtures/__directory_in_default/parameter/optional diff --git a/cdist/test/cdist_type/__init__.py b/cdist/test/cdist_type/__init__.py index 36a524b4..ccbf6742 100644 --- a/cdist/test/cdist_type/__init__.py +++ b/cdist/test/cdist_type/__init__.py @@ -153,3 +153,10 @@ class TypeTestCase(test.CdistTestCase): self.assertFalse('optional2' in cdist_type.parameter_defaults) self.assertEqual(cdist_type.parameter_defaults['optional1'], 'value1') + def test_directory_in_default(self): + base_path = fixtures + cdist_type = core.CdistType(base_path, '__directory_in_default') + self.assertEqual( + list(sorted(cdist_type.parameter_defaults.keys())), + ['bar', 'foo'] + ) diff --git a/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/a/.gitkeep b/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/a/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/bar b/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/bar new file mode 100644 index 00000000..e69de29b diff --git a/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/foo b/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/default/foo new file mode 100644 index 00000000..e69de29b diff --git a/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/optional b/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/optional new file mode 100644 index 00000000..3bd1f0e2 --- /dev/null +++ b/cdist/test/cdist_type/fixtures/__directory_in_default/parameter/optional @@ -0,0 +1,2 @@ +foo +bar