Refactored ExecutionContext serialization (added sheerkapickle) and added History management

This commit is contained in:
2020-01-31 18:58:03 +01:00
parent fed0735eb9
commit b9afcba61f
31 changed files with 1546 additions and 518 deletions
+32
View File
@@ -1,5 +1,6 @@
import core.utils
import pytest
from core.concept import ConceptParts
from core.tokenizer import Token, TokenKind
@@ -130,6 +131,37 @@ def test_i_can_escape():
assert actual == "hello \\'world\\' my friend"
@pytest.mark.parametrize("text, expected_key, expected_id", [
(None, None, None),
(10, None, None),
("", None, None),
("xxx", None, None),
(":c:", None, None),
(":c:key", None, None),
(":c:key:", "key", None),
(":c:key:id", None, None),
(":c:key:id:", "key", "id"),
])
def test_i_can_decode_concept_repr(text, expected_key, expected_id):
k, i = core.utils.decode_concept(text)
assert k == expected_key
assert i == expected_id
@pytest.mark.parametrize("text, expected", [
(None, None),
(10, None),
("", None),
("xxx", None),
("xxx.", None),
("xxx.yyy", None),
("core.concept.ConceptParts.BODY", ConceptParts.BODY),
])
def test_i_can_decode_enum(text, expected):
actual = core.utils.decode_enum(text)
assert actual == expected
def get_tokens(lst):
res = []
for e in lst: