Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2
Revisão | b68129d38b7967c3852e0fc8d6fbf83fad522332 (tree) |
---|---|
Hora | 2024-03-08 23:45:19 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
ProtocolWrapper.getattr, now tested
@@ -84,6 +84,11 @@ | ||
84 | 84 | def test_GenericProtocol_kind_b(base, sub_b): |
85 | 85 | assert_GP_kind(base, sub_b) |
86 | 86 | |
87 | +def test_GenericProtocol_delegate(base): | |
88 | + """The GenericProtocol delegates all methods to it `based_on` protocol. By examples ``._noEvents()``. | |
89 | + We use that to verify delegation""" | |
90 | + specialised = ProtocolWrapper("", based_on=base, arguments=(Argument(value=1),)) | |
91 | + assert specialised._noEvents() == 0 #Note: the number is less relevant, goal is to check _noEvents is send to base | |
87 | 92 | |
88 | 93 | def assert_GP_name(base, sub): |
89 | 94 | assert "Wrapper" in sub.based_on.name |