Fix tests

This commit is contained in:
Ivan Kravets
2019-10-17 12:38:35 +03:00
parent 27fc19d6b3
commit 83f25cbc16
2 changed files with 8 additions and 10 deletions

View File

@ -170,7 +170,7 @@ sentence=This is Arduino library
} }
def test_library_json_model(): def test_library_json_schema():
contents = """ contents = """
{ {
"name": "ArduinoJson", "name": "ArduinoJson",
@ -255,7 +255,7 @@ def test_library_json_model():
) )
def test_library_properties_model(): def test_library_properties_schema():
contents = """ contents = """
name=U8glib name=U8glib
version=1.19.1 version=1.19.1
@ -351,7 +351,7 @@ includes=MozziGuts.h
) )
def test_platform_json_model(): def test_platform_json_schema():
contents = """ contents = """
{ {
"name": "atmelavr", "name": "atmelavr",
@ -404,7 +404,7 @@ def test_platform_json_model():
raw_data = parser.ManifestParserFactory.new( raw_data = parser.ManifestParserFactory.new(
contents, parser.ManifestFileType.PLATFORM_JSON contents, parser.ManifestFileType.PLATFORM_JSON
).as_dict() ).as_dict()
raw_data["frameworks"] = sorted(raw_data["frameworks"])
data, errors = ManifestSchema(strict=False).load(raw_data) data, errors = ManifestSchema(strict=False).load(raw_data)
assert not errors assert not errors
@ -426,13 +426,13 @@ def test_platform_json_model():
"url": "https://github.com/platformio/platform-atmelavr.git", "url": "https://github.com/platformio/platform-atmelavr.git",
"type": "git", "type": "git",
}, },
"frameworks": ["arduino", "simba"], "frameworks": sorted(["arduino", "simba"]),
"version": "1.15.0", "version": "1.15.0",
}, }
) )
def test_package_json_model(): def test_package_json_schema():
contents = """ contents = """
{ {
"name": "tool-scons", "name": "tool-scons",
@ -591,7 +591,7 @@ def test_examples_from_dir(tmpdir_factory):
) )
def test_broken_models(): def test_broken_schemas():
# non-strict mode # non-strict mode
data, errors = ManifestSchema(strict=False).load(dict(name="MyPackage")) data, errors = ManifestSchema(strict=False).load(dict(name="MyPackage"))
assert set(errors.keys()) == set(["version"]) assert set(errors.keys()) == set(["version"])

View File

@ -50,8 +50,6 @@ commands =
sphinx-build -W -b linkcheck docs docs/_build/html sphinx-build -W -b linkcheck docs docs/_build/html
[testenv:skipexamples] [testenv:skipexamples]
deps =
pytest
commands = commands =
py.test -v --basetemp="{envtmpdir}" tests --ignore tests/test_examples.py py.test -v --basetemp="{envtmpdir}" tests --ignore tests/test_examples.py