<filename>tests/complexeval.py
# Copyright Notice:
# Copyright 2017-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Service-Validator/blob/master/LICENSE.md
#
# Unit tests for RedfishServiceValidator.py
#

from unittest import TestCase
from unittest import mock
import datetime
import sys

sys.path.append('../')

import json, os
import traverseService as rst
import RedfishServiceValidator as rsv
from bs4 import BeautifulSoup

rsvLogger = rst.getLogger()
rsvLogger.disabled = True
rst.config['metadatafilepath'] = './tests/testdata/schemas'

class ValidatorTest(TestCase):

    """
    Tests for functions setup_operation() and run_systems_operation()
    """
    def test_example(self):
        with open('tests/testdata/payloads/simple.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

    def test_example_bad(self):
        with open('tests/testdata/payloads/simple_bad.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

    def test_example_complex(self):
        return True
        with open('tests/testdata/payloads/simple_complex.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

<filename>tests/complexeval.py
# Copyright Notice:
# Copyright 2017-2019 DMTF. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Service-Validator/blob/master/LICENSE.md
#
# Unit tests for RedfishServiceValidator.py
#

from unittest import TestCase
from unittest import mock
import datetime
import sys

sys.path.append('../')

import json, os
import traverseService as rst
import RedfishServiceValidator as rsv
from bs4 import BeautifulSoup

rsvLogger = rst.getLogger()
rsvLogger.disabled = True
rst.config['metadatafilepath'] = './tests/testdata/schemas'

class ValidatorTest(TestCase):

    """
    Tests for functions setup_operation() and run_systems_operation()
    """
    def test_example(self):
        with open('tests/testdata/payloads/simple.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

    def test_example_bad(self):
        with open('tests/testdata/payloads/simple_bad.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

    def test_example_complex(self):
        return True
        with open('tests/testdata/payloads/simple_complex.json') as f:
            example_json = json.load(f)

        rsc = rst.ResourceObj('test', 'test', example_json, None, None, None, False)
        for prop in rsc.getResourceProperties():
                propMessages, propCounts = rsv.checkPropertyConformance(rsc.schemaObj, prop.name, prop, rsc.jsondata, parentURI='')
                print(propMessages)
                print(propCounts)

# Copyright Notice: # Copyright 2017-2019 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Service-Validator/blob/master/LICENSE.md # # Unit tests for RedfishServiceValidator.py # Tests for functions setup_operation() and run_systems_operation()