b644fe41752c6634beabd8fceabc62ab709cebda
[osm/MON.git] / policy_module / osm_policy_module / tests / test_examples.py
1 import json
2 import unittest
3
4 import os
5
6 from jsonschema import validate
7
8
9 class ExamplesTest(unittest.TestCase):
10 def test_examples_schema(self):
11 # TODO: Test that valid examples correspond to schema.
12 # This forces the modification of the examples in case of schema changes.
13 example_file_path = os.path.join(os.path.dirname(__file__), './examples/configure_scaling_full_example.json')
14 schema_file_path = os.path.join(os.path.dirname(__file__), '../models/configure_scaling.json')
15 with open(example_file_path) as example_file, open(schema_file_path) as schema_file:
16 validate(json.load(example_file), json.load(schema_file))
17
18
19 if __name__ == '__main__':
20 unittest.main()