• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revision028ba92f3ebcc4c6974b845dde3c6c978b137193 (tree)
Zeit2023-10-19 22:39:36
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

ASIS (busy with NameSpace: ... refactored test on search; now in NS

Ändern Zusammenfassung

Diff

diff -r f5671ba9421e -r 028ba92f3ebc pytst/aigr/test_3_namespaces.py
--- a/pytst/aigr/test_3_namespaces.py Thu Oct 19 15:32:35 2023 +0200
+++ b/pytst/aigr/test_3_namespaces.py Thu Oct 19 15:39:36 2023 +0200
@@ -47,6 +47,7 @@
4747 assert False, """`aNS.getID("Deze Bestaat Niet")` should raise an error"""
4848 except NameError: pass
4949
50+
5051 def test_3_sourceNS_combi(a_node, sourceNS):
5152 "The functionality as shown in _NS1 & _NS2 should also work with Source_NS"
5253 name = a_node.name
@@ -59,6 +60,7 @@
5960 assert False, """`sourceNS.getID("Deze Bestaat Niet")` should raise an error"""
6061 except NameError: pass
6162
63+
6264 def test_4_sameName_is_replaced(aNS):
6365 logger.warning("""NOTICE: This test will issue the warning 'astle.aigr.namespaces:namespaces.py:42' You should ignore it""")
6466 name='TriggerWarning'
@@ -69,32 +71,6 @@
6971 aNS.register(two)
7072 assert aNS.getID(name) is two #The test
7173
72-def NSsearch(ns, dottedName):
73- "This functionality should be moved to namespace"
74-
75- parts = dottedName.split('.')
76- travarse, elm = parts[:-1], parts[-1]
77-
78- for name in travarse:
79- next_ns = ns.findNode(name)
80- if isinstance(next_ns, NameSpace):
81- ns = next_ns
82- else:
83- return None # no found or no namespace
84- return ns.findNode(elm)
85-
86-
87-def test_5a_ns_in_ns_with_NSsearch():
88- "when we import a NS, we get a NS in a NS ..."
89- top = NameSpace('top')
90- sub = NameSpace('sub')
91- elm = DummyNode('elm', dummy="with.dotted.Name")
92- top.register(sub)
93- sub.register(elm)
94-
95- assert top.getID('sub') is sub
96- assert sub.getID('elm') is elm
97- assert NSsearch(top, dottedName="sub.elm") is elm
9874
9975 def test_5b_ns_in_ns():
10076 "when we import a NS, we get a NS in a NS ..."
@@ -108,4 +84,7 @@
10884 assert sub.getID('elm') is elm
10985 assert top.search(dottedName="sub.elm") is elm
11086
87+@pytest.mark.skip("Todo: Unite `.search()` and `.find()` [& `.getID()] -- see comment in `aigr/namespaces.py`")
88+def test_to_do_Unite():
89+ assert False
11190