forked from Domain-Connect/Templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
23 lines (23 loc) · 846 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
language: python
python:
- "3.6"
install:
- pip install jsonschema
script:
- |
for filename in *.json; do
echo 'Checking schema for ' $filename
jsonschema -i $filename template.schema || exit 1
done
- |
python -c "import json
import os
errors = []
for file_to_check in [r for r in os.listdir(os.curdir) if r.endswith('.json')]:
with open(file_to_check) as f:
template_json = json.load(f)
expected_filename = '{}.{}.json'.format(template_json['providerId'].lower(), template_json['serviceId'].lower())
if expected_filename != file_to_check:
errors += ['File name {} not matching the pattern. Expected {}'.format(file_to_check, expected_filename)]
if len(errors) > 0:
assert False, '\n'.join(errors)"