aboutsummaryrefslogtreecommitdiffstats
path: root/ice_validator/tests/test_base_template_names.py
diff options
context:
space:
mode:
authorstark, steven <steven.stark@att.com>2018-12-17 12:43:02 -0800
committerstark, steven <steven.stark@att.com>2018-12-17 13:04:00 -0800
commit1f4df7c7ad27b23773ad9cdbe4db1632ce388cf1 (patch)
tree8092104f8be23051ff81c9f71ee34116df4d33ba /ice_validator/tests/test_base_template_names.py
parentca9085f0f77d442d3741a8c754e65cc45b6a318d (diff)
[VVP] updating validation scripts in dublin
- adding backlog of new validation scripts for dublin - updating existing tests - removing outdated tests Issue-ID: VVP-123 Change-Id: Ib8260889ac957c1dd28d8ede450fc8edc6fb0ec0 Signed-off-by: stark, steven <steven.stark@att.com>
Diffstat (limited to 'ice_validator/tests/test_base_template_names.py')
-rw-r--r--ice_validator/tests/test_base_template_names.py30
1 files changed, 16 insertions, 14 deletions
diff --git a/ice_validator/tests/test_base_template_names.py b/ice_validator/tests/test_base_template_names.py
index dbc8815..5dce061 100644
--- a/ice_validator/tests/test_base_template_names.py
+++ b/ice_validator/tests/test_base_template_names.py
@@ -48,32 +48,34 @@ import re
from .helpers import check_basename_ending
from .helpers import validates
-VERSION = '1.2.0'
+VERSION = "1.2.0"
# is 'base', starts with 'base_', contains '_base_', ends with '_base'
-RE_BASE = re.compile(r'(^base$)|(^base_)|(_base_)|(_base$)')
+RE_BASE = re.compile(r"(^base$)|(^base_)|(_base_)|(_base$)")
-@validates('R-37028', 'R-87485', 'R-81339', 'R-87247', 'R-76057')
+@validates("R-37028", "R-87485", "R-81339", "R-87247", "R-76057")
def test_base_template_names(template_dir):
- '''
+ """
Check all base templates have a filename that includes "_base_".
- '''
+ """
base_template_count = 0
- filenames = [f for f in listdir(template_dir)
- if path.isfile(path.join(template_dir, f)) and
- path.splitext(f)[-1] in ['.yaml', '.yml']]
+ filenames = [
+ f
+ for f in listdir(template_dir)
+ if path.isfile(path.join(template_dir, f))
+ and path.splitext(f)[-1] in [".yaml", ".yml"]
+ ]
for filename in filenames:
filename = path.splitext(filename)[0]
# volume templates are tied to their parent naming wise
- if check_basename_ending('volume', filename):
+ if check_basename_ending("volume", filename):
continue
if RE_BASE.search(filename.lower()):
base_template_count += 1
- assert base_template_count == 1, (
- 'must be 1 "*_base_*" in %s not %d' % (
- filenames,
- base_template_count))
-
+ assert base_template_count == 1, 'must be 1 "*_base_*" in %s not %d' % (
+ filenames,
+ base_template_count,
+ )