| # Copyright (c) 2020 Intel Corporation |
| # SPDX-License-Identifier: Apache-2.0 |
| This test file contains foundational testcases for Sanitycheck tool |
| ZEPHYR_BASE = os.getenv("ZEPHYR_BASE") |
| sys.path.insert(0, os.path.join(ZEPHYR_BASE, "scripts/sanity_chk")) |
| from sanitylib import SanityConfigParser |
| @pytest.fixture(name='test_data') |
| """ Pytest fixture to set the path of test_data""" |
| data = ZEPHYR_BASE + "/scripts/tests/sanitycheck/test_data/" |
| """ Test to check if loading the non-existent files raises the errors """ |
| filename = 'testcase_nc.yaml' |
| with pytest.raises(FileNotFoundError): |
| def test_correct_testcase_schema(test_data): |
| """ Test to validate the testcase schema""" |
| filename = test_data + 'testcase_correct_schema.yaml' |
| schema = scl.yaml_load(ZEPHYR_BASE +'/scripts/sanity_chk/testcase-schema.yaml') |
| data = SanityConfigParser(filename, schema) |