Skip to content

Commit dc75a5e

Browse files
committed
Fix testSchema.yaml and setup.py issue
1 parent 4bc9d30 commit dc75a5e

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.2.1] - 2017-09-21
2+
### Fixed
3+
- Rename testSchema.yaml to test_schema.py
4+
15
## [1.2] = 2017-09-20
26
### Added
37
- Changelog

nuts/service/file_validator.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import logging
55

6-
import os
76
from pykwalify.core import Core, SchemaError
87

8+
from nuts.service.test_schema import TEST_SCHEMA
9+
910

1011
class FileValidator(object):
1112
def __init__(self, test_file):
@@ -14,10 +15,8 @@ def __init__(self, test_file):
1415
self.validation_logger = logging.getLogger('nuts-validation')
1516

1617
def validate(self):
17-
cur_dir = os.path.dirname(__file__)
18-
test_file = os.path.join(cur_dir, 'testSchema.yaml')
1918
try:
20-
c = Core(source_file=self.test_file, schema_files=[test_file])
19+
c = Core(source_file=self.test_file, schema_data=TEST_SCHEMA)
2120
c.validate(raise_exception=True)
2221
return True
2322
except SchemaError as e:

nuts/service/testSchema.yaml renamed to nuts/service/test_schema.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
from __future__ import absolute_import
2+
from __future__ import unicode_literals
3+
4+
import yaml
5+
6+
SCHEMA = '''
17
type: seq
28
sequence:
39
- type: map
@@ -42,4 +48,7 @@
4248
save:
4349
type: str
4450
required: no
45-
teardown: *commands
51+
teardown: *commands
52+
'''
53+
54+
TEST_SCHEMA = yaml.safe_load(SCHEMA)

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
readme = open('README.rst').read()
1212

1313
setup(name='nuts',
14-
version='1.2',
14+
version='1.2.1',
1515
description='A Network Unit Test System',
1616
author='Andreas Stalder, David Meister, Matthias Gabriel, Urs Baumann',
1717
author_email='astalder@hsr.ch, dmeister@hsr.ch, mgabriel@hsr.ch, ubaumann@ins.hsr.ch',
1818
url='https://github.com/HSRNetwork/Nuts',
1919
packages=find_packages(),
20-
data_files=[('nuts/service', ['nuts/service/testSchema.yaml'])],
2120
zip_safe=False,
2221
include_package_data=True,
2322
license='MIT',

0 commit comments

Comments
 (0)