Files
Sheerka-Old/tests/test_concept.py
T
2019-11-09 17:29:50 +01:00

39 lines
849 B
Python

import pytest
from core.concept import Concept
@pytest.mark.parametrize("name, variables, expected", [
("my name is a", ["a"], "my name is __var__0"),
("a b c d", ["b", "c"], "a __var__0 __var__1 d"),
("a 'b c' d", ["b", "c"], "a b c d"),
("a | b", ["a", "b"], "__var__0 | __var__1"),
("a b a c", ["a", "b"], "__var__0 __var__1 __var__0 c"),
("a b a c", ["b", "a"], "__var__1 __var__0 __var__1 c"),
])
def test_i_can_get_concept_key(name, variables, expected):
concept = Concept(name)
for v in variables:
concept.set_prop(v, None)
concept.init_key()
assert concept.key == expected
def test_i_can_serialize():
"""
Test concept.to_dict()
:return:
"""
# TODO
pass
def test_i_can_deserialize():
"""
Test concept.from_dict()
:return:
"""
# TODO
pass