• R/O
  • SSH

Commit

Tags
Aucun tag

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

Révision7b4046efaf011309d027334fe0e5c120d7736f47 (tree)
l'heure2024-04-10 22:05:34
AuteurAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Message de Log

ASIS/refactored

Change Summary

Modification

diff -r 1e3066c73dad -r 7b4046efaf01 base_packages/castle-aigr/Makefile
--- a/base_packages/castle-aigr/Makefile Wed Apr 10 10:19:45 2024 +0200
+++ b/base_packages/castle-aigr/Makefile Wed Apr 10 15:05:34 2024 +0200
@@ -4,16 +4,12 @@
44 PYREVERSE_PKGS = castle/aigr castle/aigr.machinery
55
66 LAST = \
7- pytst/test_3_namespaces.py \
8- pytst/test_2c_GenericProtocols.py \
97 #
108 CURRENT = \
11- pytst/machinery/test_0_dataclass.py \
12- pytst/machinery/test_0.py \
139 #
1410 TODO = \
15- pytst/test_SpecialiseGenerics.py \
16- pytst/test_0_AIGR.py \
11+ pytst/test_3_namespaces.py \
12+ pytst/machinery/test_9_todo.py \
1713 #
1814
1915 TOPd=../../
diff -r 1e3066c73dad -r 7b4046efaf01 base_packages/castle-aigr/pytst/machinery/test_0.py
--- a/base_packages/castle-aigr/pytst/machinery/test_0.py Wed Apr 10 10:19:45 2024 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
1-# (C) Albert Mietus, 2024. Part of Castle/CCastle project
2-
3-"""No functional tests; only testing to instantiate the classes in Machinery"""
4-
5-import pytest
6-
7-from castle.aigr import machinery
8-
9-class Demo_DirectCall(machinery.machinery):
10- """Just a demo"""
11-
12-def test_Abstact_machinery():
13- m = machinery.machinery()
14- assert m.delegate is None
15-
16-def test_DC_machinery():
17- m = machinery.machinery(delegate=Demo_DirectCall)
18- assert m.delegate is Demo_DirectCall
19-
20-def test_send_proto_OutPort_Dummy():
21- o = machinery.send_proto(outport='Dummy')
22- assert o.outport=='Dummy'
23-
24-def test_send_proto_needsOutPort():
25- with pytest.raises(TypeError, match="""'outport'"""):
26- o = machinery.send_proto()
27-
28-def test_ToDo__sendStreamd():
29- with pytest.raises(NotImplementedError, match='ToDo'):
30- machinery.sendStream(outport='*')
31-
32-def test_ToDo__sendData():
33- with pytest.raises(NotImplementedError, match='ToDo'):
34- machinery.sendData(outport='*')
35-
36-def test_sendEvent_CastleCode():
37- """ CastleCode (sieve/basic) Generator:: `StartSieve.runTo(max) on .controll`
38- ``.outlet.input(i);``
39- """
40- o = machinery.sendEvent(outport='self.outlet', event='input', arguments=('i',))
41- assert o.outport == 'self.outlet'
42- assert o.event == 'input'
43- assert len(o.arguments)==1
44- assert o.arguments[0]=='i'
45-
46-def test_connection_CastleCode():
47- """CastleCode (sieve/basic) Main:: `init()`
48- ``.generator.outlet = .finder.newPrime;``
49- """
50- o = machinery.connection(outport='self.generator.outlet', inport='self.finder.newPrime')
51- assert o.outport == 'self.generator.outlet'
52- assert o.inport == 'self.finder.newPrime'
53-
54-def test_connection_bothPortsNeeded():
55- with pytest.raises(TypeError, match="'inport'"):
56- machinery.connection(outport='Dummy')
57- with pytest.raises(TypeError, match="'outport'"):
58- machinery.connection(inport='Dummy')
59- with pytest.raises(TypeError, match='2 required keyword-only arguments'):
60- machinery.connection()
61-
62-def test_DispatchTable():
63- o = machinery.DispatchTable(handlers=[])
64- assert len(o.handlers) == 0 # trivial test -- see eDispatchTable
65-
66-def test_eDispatchTable():
67- o = machinery.eDispatchTable(handlers=['callable0', 'callable1',])
68- assert o.handlers[0] == 'callable0'
69- assert o.handlers[1] == 'callable1'
70- assert len(o.handlers) == 2
71-
72-
diff -r 1e3066c73dad -r 7b4046efaf01 base_packages/castle-aigr/pytst/machinery/test_1_machinery.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_packages/castle-aigr/pytst/machinery/test_1_machinery.py Wed Apr 10 15:05:34 2024 +0200
@@ -0,0 +1,72 @@
1+# (C) Albert Mietus, 2024. Part of Castle/CCastle project
2+
3+"""No functional tests; only testing to instantiate the classes in Machinery"""
4+
5+import pytest
6+
7+from castle.aigr import machinery
8+
9+class Demo_DirectCall(machinery.machinery):
10+ """Just a demo"""
11+
12+def test_Abstact_machinery():
13+ m = machinery.machinery()
14+ assert m.delegate is None
15+
16+def test_DC_machinery():
17+ m = machinery.machinery(delegate=Demo_DirectCall)
18+ assert m.delegate is Demo_DirectCall
19+
20+def test_send_proto_OutPort_Dummy():
21+ o = machinery.send_proto(outport='Dummy')
22+ assert o.outport=='Dummy'
23+
24+def test_send_proto_needsOutPort():
25+ with pytest.raises(TypeError, match="""'outport'"""):
26+ o = machinery.send_proto()
27+
28+def test_ToDo__sendStreamd():
29+ with pytest.raises(NotImplementedError, match='ToDo'):
30+ machinery.sendStream(outport='*')
31+
32+def test_ToDo__sendData():
33+ with pytest.raises(NotImplementedError, match='ToDo'):
34+ machinery.sendData(outport='*')
35+
36+def test_sendEvent_CastleCode():
37+ """ CastleCode (sieve/basic) Generator:: `StartSieve.runTo(max) on .controll`
38+ ``.outlet.input(i);``
39+ """
40+ o = machinery.sendEvent(outport='self.outlet', event='input', arguments=('i',))
41+ assert o.outport == 'self.outlet'
42+ assert o.event == 'input'
43+ assert len(o.arguments)==1
44+ assert o.arguments[0]=='i'
45+
46+def test_connection_CastleCode():
47+ """CastleCode (sieve/basic) Main:: `init()`
48+ ``.generator.outlet = .finder.newPrime;``
49+ """
50+ o = machinery.connection(outport='self.generator.outlet', inport='self.finder.newPrime')
51+ assert o.outport == 'self.generator.outlet'
52+ assert o.inport == 'self.finder.newPrime'
53+
54+def test_connection_bothPortsNeeded():
55+ with pytest.raises(TypeError, match="'inport'"):
56+ machinery.connection(outport='Dummy')
57+ with pytest.raises(TypeError, match="'outport'"):
58+ machinery.connection(inport='Dummy')
59+ with pytest.raises(TypeError, match='2 required keyword-only arguments'):
60+ machinery.connection()
61+
62+def test_DispatchTable():
63+ o = machinery.DispatchTable(handlers=[])
64+ assert len(o.handlers) == 0 # trivial test -- see eDispatchTable
65+
66+def test_eDispatchTable():
67+ o = machinery.eDispatchTable(handlers=['callable0', 'callable1',])
68+ assert o.handlers[0] == 'callable0'
69+ assert o.handlers[1] == 'callable1'
70+ assert len(o.handlers) == 2
71+
72+
diff -r 1e3066c73dad -r 7b4046efaf01 base_packages/castle-aigr/pytst/machinery/test_9_todo.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/base_packages/castle-aigr/pytst/machinery/test_9_todo.py Wed Apr 10 15:05:34 2024 +0200
@@ -0,0 +1,17 @@
1+# (C) Albert Mietus, 2024. Part of Castle/CCastle project
2+
3+
4+import pytest
5+from castle.aigr import machinery
6+
7+
8+@pytest.mark.skip("\t sendStream: Other protocol then Event are not planned yet")
9+def test_sendStream():
10+ assert False
11+@pytest.mark.skip("\t sendData: Other protocol then Event are not planned yet")
12+def test_sendData():
13+ assert False
14+
15+@pytest.mark.skip("\t Handlers in eDispatchTable: The Handler AIGR isn't defined")
16+def test_DispatchTables_Handlers():
17+ assert False