mirror of
https://github.com/enzet/map-machine.git
synced 2025-07-27 05:19:00 +02:00
Refactor scheme test.
This commit is contained in:
parent
6d3180724b
commit
a554d28c5c
1 changed files with 17 additions and 22 deletions
|
@ -1,29 +1,24 @@
|
||||||
"""
|
"""
|
||||||
Test scheme parsing.
|
Test scheme parsing.
|
||||||
"""
|
"""
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
from map_machine.scheme import Scheme
|
from map_machine.scheme import Scheme
|
||||||
|
|
||||||
|
|
||||||
def test_verification() -> None:
|
def test_verification() -> None:
|
||||||
assert (
|
"""Test verification process of tags in scheme."""
|
||||||
Scheme(
|
|
||||||
{
|
tags: dict[str, Any] = {
|
||||||
"colors": {"default": "#444444"},
|
"colors": {"default": "#444444"},
|
||||||
"node_icons": [{"tags": [{"tags": {"a": "b"}}]}],
|
"node_icons": [{"tags": [{"tags": {"a": "b"}}]}],
|
||||||
}
|
}
|
||||||
)
|
assert Scheme(tags).node_matchers[0].verify() is True
|
||||||
.node_matchers[0]
|
|
||||||
.verify()
|
# Tag value should be string, not integer.
|
||||||
is True
|
|
||||||
)
|
tags: dict[str, Any] = {
|
||||||
assert (
|
"colors": {"default": "#444444"},
|
||||||
Scheme(
|
"node_icons": [{"tags": [{"tags": {"a": 0}}]}],
|
||||||
{
|
}
|
||||||
"colors": {"default": "#444444"},
|
assert Scheme(tags).node_matchers[0].verify() is False
|
||||||
"node_icons": [{"tags": [{"tags": {"a": 0}}]}],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.node_matchers[0]
|
|
||||||
.verify()
|
|
||||||
is False
|
|
||||||
)
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue