cactus-test-definitions 1.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of cactus-test-definitions might be problematic. Click here for more details.

Files changed (139) hide show
  1. cactus_test_definitions/__init__.py +39 -0
  2. cactus_test_definitions/__pycache__/__init__.cpython-312.pyc +0 -0
  3. cactus_test_definitions/__pycache__/actions.cpython-312.pyc +0 -0
  4. cactus_test_definitions/__pycache__/checks.cpython-312.pyc +0 -0
  5. cactus_test_definitions/__pycache__/csipaus.cpython-312.pyc +0 -0
  6. cactus_test_definitions/__pycache__/errors.cpython-312.pyc +0 -0
  7. cactus_test_definitions/__pycache__/events.cpython-312.pyc +0 -0
  8. cactus_test_definitions/__pycache__/parameters.cpython-312.pyc +0 -0
  9. cactus_test_definitions/__pycache__/schema.cpython-312.pyc +0 -0
  10. cactus_test_definitions/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc +0 -0
  11. cactus_test_definitions/__pycache__/test_procedures.cpython-312.pyc +0 -0
  12. cactus_test_definitions/__pycache__/variable_expressions.cpython-312.pyc +0 -0
  13. cactus_test_definitions/__pycache__/version.cpython-312.pyc +0 -0
  14. cactus_test_definitions/client/__init__.py +26 -0
  15. cactus_test_definitions/client/__pycache__/__init__.cpython-312.pyc +0 -0
  16. cactus_test_definitions/client/__pycache__/actions.cpython-312.pyc +0 -0
  17. cactus_test_definitions/client/__pycache__/checks.cpython-312.pyc +0 -0
  18. cactus_test_definitions/client/__pycache__/events.cpython-312.pyc +0 -0
  19. cactus_test_definitions/client/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc +0 -0
  20. cactus_test_definitions/client/__pycache__/validate.cpython-312.pyc +0 -0
  21. cactus_test_definitions/client/actions.py +98 -0
  22. cactus_test_definitions/client/checks.py +127 -0
  23. cactus_test_definitions/client/events.py +71 -0
  24. cactus_test_definitions/client/procedures/ALL-01.yaml +94 -0
  25. cactus_test_definitions/client/procedures/ALL-02.yaml +113 -0
  26. cactus_test_definitions/client/procedures/ALL-03-REJ.yaml +69 -0
  27. cactus_test_definitions/client/procedures/ALL-03.yaml +110 -0
  28. cactus_test_definitions/client/procedures/ALL-04.yaml +69 -0
  29. cactus_test_definitions/client/procedures/ALL-05.yaml +117 -0
  30. cactus_test_definitions/client/procedures/ALL-06.yaml +128 -0
  31. cactus_test_definitions/client/procedures/ALL-07.yaml +76 -0
  32. cactus_test_definitions/client/procedures/ALL-08.yaml +78 -0
  33. cactus_test_definitions/client/procedures/ALL-09.yaml +111 -0
  34. cactus_test_definitions/client/procedures/ALL-10.yaml +128 -0
  35. cactus_test_definitions/client/procedures/ALL-11.yaml +111 -0
  36. cactus_test_definitions/client/procedures/ALL-12.yaml +108 -0
  37. cactus_test_definitions/client/procedures/ALL-13.yaml +112 -0
  38. cactus_test_definitions/client/procedures/ALL-14.yaml +165 -0
  39. cactus_test_definitions/client/procedures/ALL-15.yaml +109 -0
  40. cactus_test_definitions/client/procedures/ALL-16.yaml +102 -0
  41. cactus_test_definitions/client/procedures/ALL-17.yaml +63 -0
  42. cactus_test_definitions/client/procedures/ALL-18.yaml +288 -0
  43. cactus_test_definitions/client/procedures/ALL-19.yaml +78 -0
  44. cactus_test_definitions/client/procedures/ALL-20.yaml +136 -0
  45. cactus_test_definitions/client/procedures/ALL-21.yaml +203 -0
  46. cactus_test_definitions/client/procedures/ALL-22.yaml +82 -0
  47. cactus_test_definitions/client/procedures/ALL-23.yaml +158 -0
  48. cactus_test_definitions/client/procedures/ALL-24.yaml +132 -0
  49. cactus_test_definitions/client/procedures/ALL-25-EXT.yaml +228 -0
  50. cactus_test_definitions/client/procedures/ALL-25.yaml +136 -0
  51. cactus_test_definitions/client/procedures/ALL-26.yaml +147 -0
  52. cactus_test_definitions/client/procedures/ALL-27.yaml +144 -0
  53. cactus_test_definitions/client/procedures/ALL-28.yaml +274 -0
  54. cactus_test_definitions/client/procedures/ALL-29.yaml +87 -0
  55. cactus_test_definitions/client/procedures/ALL-30.yaml +188 -0
  56. cactus_test_definitions/client/procedures/BES-01.yaml +136 -0
  57. cactus_test_definitions/client/procedures/BES-02.yaml +137 -0
  58. cactus_test_definitions/client/procedures/BES-03.yaml +135 -0
  59. cactus_test_definitions/client/procedures/BES-04.yaml +228 -0
  60. cactus_test_definitions/client/procedures/DRA-01.yaml +54 -0
  61. cactus_test_definitions/client/procedures/DRA-02.yaml +64 -0
  62. cactus_test_definitions/client/procedures/DRD-01.yaml +667 -0
  63. cactus_test_definitions/client/procedures/DRL-01.yaml +327 -0
  64. cactus_test_definitions/client/procedures/GEN-01.yaml +73 -0
  65. cactus_test_definitions/client/procedures/GEN-02.yaml +72 -0
  66. cactus_test_definitions/client/procedures/GEN-03.yaml +160 -0
  67. cactus_test_definitions/client/procedures/GEN-04.yaml +161 -0
  68. cactus_test_definitions/client/procedures/GEN-05.yaml +89 -0
  69. cactus_test_definitions/client/procedures/GEN-06.yaml +90 -0
  70. cactus_test_definitions/client/procedures/GEN-07.yaml +145 -0
  71. cactus_test_definitions/client/procedures/GEN-08.yaml +145 -0
  72. cactus_test_definitions/client/procedures/GEN-09.yaml +117 -0
  73. cactus_test_definitions/client/procedures/GEN-10.yaml +739 -0
  74. cactus_test_definitions/client/procedures/GEN-11.yaml +378 -0
  75. cactus_test_definitions/client/procedures/GEN-12.yaml +378 -0
  76. cactus_test_definitions/client/procedures/GEN-13.yaml +70 -0
  77. cactus_test_definitions/client/procedures/LOA-01.yaml +73 -0
  78. cactus_test_definitions/client/procedures/LOA-02.yaml +73 -0
  79. cactus_test_definitions/client/procedures/LOA-03.yaml +160 -0
  80. cactus_test_definitions/client/procedures/LOA-04.yaml +161 -0
  81. cactus_test_definitions/client/procedures/LOA-05.yaml +89 -0
  82. cactus_test_definitions/client/procedures/LOA-06.yaml +89 -0
  83. cactus_test_definitions/client/procedures/LOA-07.yaml +145 -0
  84. cactus_test_definitions/client/procedures/LOA-08.yaml +145 -0
  85. cactus_test_definitions/client/procedures/LOA-09.yaml +117 -0
  86. cactus_test_definitions/client/procedures/LOA-10.yaml +741 -0
  87. cactus_test_definitions/client/procedures/LOA-11.yaml +378 -0
  88. cactus_test_definitions/client/procedures/LOA-12.yaml +378 -0
  89. cactus_test_definitions/client/procedures/LOA-13.yaml +71 -0
  90. cactus_test_definitions/client/procedures/MUL-01.yaml +92 -0
  91. cactus_test_definitions/client/procedures/MUL-02.yaml +80 -0
  92. cactus_test_definitions/client/procedures/MUL-03.yaml +74 -0
  93. cactus_test_definitions/client/test_procedures.py +185 -0
  94. cactus_test_definitions/client/validate.py +98 -0
  95. cactus_test_definitions/csipaus.py +81 -0
  96. cactus_test_definitions/errors.py +15 -0
  97. cactus_test_definitions/parameters.py +153 -0
  98. cactus_test_definitions/py.typed +0 -0
  99. cactus_test_definitions/schema.py +22 -0
  100. cactus_test_definitions/server/README.md +170 -0
  101. cactus_test_definitions/server/__init__.py +23 -0
  102. cactus_test_definitions/server/__pycache__/__init__.cpython-312.pyc +0 -0
  103. cactus_test_definitions/server/__pycache__/actions.cpython-312.pyc +0 -0
  104. cactus_test_definitions/server/__pycache__/checks.cpython-312.pyc +0 -0
  105. cactus_test_definitions/server/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc +0 -0
  106. cactus_test_definitions/server/__pycache__/validate.cpython-312.pyc +0 -0
  107. cactus_test_definitions/server/actions.py +139 -0
  108. cactus_test_definitions/server/checks.py +117 -0
  109. cactus_test_definitions/server/procedures/S-ALL-01.yaml +42 -0
  110. cactus_test_definitions/server/procedures/S-ALL-02.yaml +65 -0
  111. cactus_test_definitions/server/procedures/S-ALL-03.yaml +65 -0
  112. cactus_test_definitions/server/procedures/S-ALL-04.yaml +137 -0
  113. cactus_test_definitions/server/procedures/S-ALL-05.yaml +111 -0
  114. cactus_test_definitions/server/procedures/S-OPT-01.yaml +42 -0
  115. cactus_test_definitions/server/procedures/S-OPT-02.yaml +40 -0
  116. cactus_test_definitions/server/procedures/S-OPT-03.yaml +44 -0
  117. cactus_test_definitions/server/procedures/S-OPT-04.yaml +32 -0
  118. cactus_test_definitions/server/test_procedures.py +122 -0
  119. cactus_test_definitions/server/validate.py +30 -0
  120. cactus_test_definitions/variable_expressions.py +419 -0
  121. cactus_test_definitions-1.6.0.dist-info/METADATA +289 -0
  122. cactus_test_definitions-1.6.0.dist-info/RECORD +139 -0
  123. cactus_test_definitions-1.6.0.dist-info/WHEEL +5 -0
  124. cactus_test_definitions-1.6.0.dist-info/licenses/LICENSE.txt +22 -0
  125. cactus_test_definitions-1.6.0.dist-info/top_level.txt +2 -0
  126. tests/__init__.py +0 -0
  127. tests/unit/__init__.py +0 -0
  128. tests/unit/client/__init__.py +0 -0
  129. tests/unit/client/test_actions.py +72 -0
  130. tests/unit/client/test_checks.py +71 -0
  131. tests/unit/client/test_events.py +36 -0
  132. tests/unit/client/test_test_procedures.py +103 -0
  133. tests/unit/client/test_validate.py +153 -0
  134. tests/unit/server/__init__.py +0 -0
  135. tests/unit/server/test_test_procedures.py +60 -0
  136. tests/unit/server/test_validate.py +62 -0
  137. tests/unit/test_csipaus.py +49 -0
  138. tests/unit/test_parameters.py +197 -0
  139. tests/unit/test_variable_expressions.py +402 -0
@@ -0,0 +1,289 @@
1
+ Metadata-Version: 2.4
2
+ Name: cactus-test-definitions
3
+ Version: 1.6.0
4
+ Summary: CSIP-AUS Client Test Harness Test Definitions
5
+ Author-email: Mike Turner <mike.turner@anu.edu.au>, Josh Vote <joshua.vote@anu.edu.au>
6
+ Maintainer-email: Mike Turner <mike.turner@anu.edu.au>, Josh Vote <joshua.vote@anu.edu.au>
7
+ Project-URL: Homepage, https://github.com/bsgip/cactus-test-definitions
8
+ Project-URL: Documentation, https://github.com/bsgip/cactus-test-definitions/blob/main/README.md
9
+ Project-URL: Repository, https://github.com/bsgip/cactus-test-definitions.git
10
+ Project-URL: Issues, https://github.com/bsgip/cactus-test-definitions/issues
11
+ Project-URL: Changelog, https://github.com/bsgip/cactus-test-definitions/blob/main/CHANGELOG.md
12
+ Keywords: CSIP-AUS,client,testing,definitions
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Software Development
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.12
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE.txt
23
+ Requires-Dist: pyyaml<7,>=6.0.2
24
+ Requires-Dist: pyyaml-include<3,>=2.2
25
+ Requires-Dist: dataclass-wizard<1,==0.35.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: bandit; extra == "dev"
28
+ Requires-Dist: black; extra == "dev"
29
+ Requires-Dist: flake8; extra == "dev"
30
+ Requires-Dist: isort; extra == "dev"
31
+ Requires-Dist: mccabe; extra == "dev"
32
+ Requires-Dist: mypy; extra == "dev"
33
+ Requires-Dist: tox; extra == "dev"
34
+ Requires-Dist: python-dotenv[cli]; extra == "dev"
35
+ Requires-Dist: types-PyYAML; extra == "dev"
36
+ Provides-Extra: test
37
+ Requires-Dist: pytest; extra == "test"
38
+ Requires-Dist: assertical; extra == "test"
39
+ Provides-Extra: docs
40
+ Requires-Dist: sphinx; extra == "docs"
41
+ Dynamic: license-file
42
+
43
+ # Cactus Test Definitions
44
+
45
+ This repository contains YAML test procedure definitions for use with the CSIP-AUS Client/Server Test Harnesses.
46
+
47
+ This repository also provides Python dataclasses to make it easier for Python code to work with these definitions. In addition, there are also helper functions for creating valid instances of these dataclasses directly from the YAML test procedure definition files.
48
+
49
+ **Client Test Procedures** can be found in the [cactus_test_definitions/client/procedures/](cactus_test_definitions/client/procedures/) directory
50
+
51
+ **Server Test Procedures** can be found in the [cactus_test_definitions/server/procedures/](cactus_test_definitions/server/procedures/) directory
52
+
53
+
54
+ ## Development / Testing
55
+
56
+ This repository also contains a small number of tests that verify that test definitions can be sucessfully converted to their equivalent python dataclasses.
57
+
58
+ First install the development and testing dependencies with,
59
+
60
+ ```sh
61
+ python -m pip install --editable .[dev,test]
62
+ ```
63
+
64
+ Once installed, run the tests with,
65
+
66
+ ```sh
67
+ pytest
68
+ ```
69
+
70
+ ## Server Test Procedure Schema
71
+
72
+ See [cactus_test_definitions/server/README.md](README)
73
+
74
+ ## Client Test Procedure Schema
75
+
76
+ A `TestProcedure` is a [YAML](https://yaml.org) configuration that describes how a CSIP-Aus Client test case should be implemented by a server / compliance body. It's designed to be human readable but interpretable by a test harness for administering a test. At its most basic level, a `TestProcedure` is a series of a "events" that a client must trigger in sequence in order to demonstrate compliance.
77
+
78
+ Here is a minimalist definition of a test case
79
+
80
+ ```
81
+ Description: Minimal Test Case Definition
82
+ Category: Explaining Schemas
83
+ Classes:
84
+ - Descriptive Test Tag 1
85
+ - Descriptive Test Tag 2
86
+ Preconditions:
87
+ # See definitions below for more info
88
+ actions:
89
+ checks:
90
+ Criteria:
91
+ # See definitions below for more info
92
+ checks:
93
+ Steps:
94
+ # See definitions below for more info
95
+ STEP_NAME:
96
+ ```
97
+
98
+ For how to actually interpret and "run" these test cases against a CSIP-Aus Server implementation, please see [cactus-runner](https://github.com/bsgip/cactus-runner) for a reference implementation.
99
+
100
+ ## Steps/Events Schema
101
+
102
+ The most basic building block of a `TestProcedure` is a `Step`. Each `Step` will always define an `Event` which dictates some form of trigger based on client behavior (eg sending a particular request). When an `Event` is triggered, each of it's `Action` elements will fire which will in turn enable/disable additional `Steps` with new events and so on until the `TestProcedure` is complete. `Event`'s can also define a set of `Check` objects (see doco below) that can restrict an `Event` from triggering if any `Check` is returning False/fail.
103
+
104
+ When a `TestProcedure` first starts, normally only a single `Step` will be active but more can be enabled/disabled in response to client behaviour.
105
+
106
+ Step Schema:
107
+ ```
108
+ Steps:
109
+ DESCRIPTIVE_TITLE_OF_STEP: # This is used to reference this step in other parts of this test procedure
110
+ event: #
111
+ type: # string identifier of the event type - see table below
112
+ parameters: # Any parameters to modify the default behaviour of the event - see table below
113
+ checks: # A list of Check definitions that will need to be true for this event to trigger - see section on Checks below
114
+ actions:
115
+ # See action schema in the Action section below
116
+ ```
117
+
118
+ These are the currently defined `Event` types that a `Step` can define
119
+ | **name** | **params** | **description** |
120
+ | -------- | ---------- | --------------- |
121
+ | `GET-request-received` | `endpoint: str` `serve_request_first: bool/None` | Triggers when a client sends a GET request to the nominated endpoint. Will trigger BEFORE serving request to server unless `serve_request_first` is `True` in which case the event will be triggered AFTER the utility server has served the request (but before being proxied back to the device client) |
122
+ | `POST-request-received` | `endpoint: str` `serve_request_first: bool/None` | Triggers when a client sends a POST request to the nominated endpoint. Will trigger BEFORE serving request to server unless `serve_request_first` is `True` in which case the event will be triggered AFTER the utility server has served the request (but before being proxied back to the device client) |
123
+ | `PUT-request-received` | `endpoint: str` `serve_request_first: bool/None` | Triggers when a client sends a PUT request to the nominated endpoint. Will trigger BEFORE serving request to server unless `serve_request_first` is `True` in which case the event will be triggered AFTER the utility server has served the request (but before being proxied back to the device client) |
124
+ | `DELETE-request-received` | `endpoint: str` `serve_request_first: bool/None` | Triggers when a client sends a DELETE request to the nominated endpoint. Will trigger BEFORE serving request to server unless `serve_request_first` is `True` in which case the event will be triggered AFTER the utility server has served the request (but before being proxied back to the device client) |
125
+ | `wait` | `duration_seconds: str` | Triggers `duration_seconds` after being initially activated |
126
+
127
+ **NOTE:** The `endpoint` parameter used by the various `-request-received` events supports a rudimentary `*` wildcard. This will match a single "component" of the path (portion deliminated by `/` characters).
128
+
129
+ eg:
130
+
131
+ * `/edev/*/derp/456/derc` will match `/edev/123/derp/456/derc`
132
+ * `/edev/*` will NOT match `/edev/123/derp/456/derc` (the `*` will only match the `123` portion - not EVERYTHING)
133
+
134
+
135
+ ### Actions
136
+
137
+ These are the currently defined `Action` elements that can be included in a test. `Action`'s can trigger at the beginning of a test (as a precondition) or whenever a `Step`'s `Event` is triggered.
138
+
139
+ `Action`'s are defined with the following schema, always as a list under an element called `actions`
140
+ ```
141
+ actions:
142
+ - type: # string identifier of the action type - see table below
143
+ parameters: # Any parameters to supply to the executed Action - see table below
144
+ ```
145
+
146
+ This is an example of two `Action` elements that will enable a different Step and create a DERControl:
147
+
148
+ ```
149
+ actions:
150
+ - type: enable-steps
151
+ parameters:
152
+ steps: NAME_OF_STEP_TO_ENABLE
153
+ - type: create-der-control
154
+ parameters:
155
+ start: $now
156
+ duration_seconds: 300
157
+ opModExpLimW: 2000
158
+ ```
159
+
160
+
161
+ | **name** | **params** | **description** |
162
+ | -------- | ---------- | --------------- |
163
+ | `enable-steps` | `steps: list[str]` | The names of `Step`'s that will be activated |
164
+ | `remove-steps` | `steps: list[str]` | The names of `Step`'s that will be deactivated (if active) |
165
+ | `finish-test` | None | When activated, the current test will be finished (shutdown) and all `Criteria` evaluated as if the client had requested finalization. |
166
+ | `set-default-der-control` | `derp_id: int/None` `opModImpLimW: float/None` `opModExpLimW: float/None` `opModLoadLimW: float/None` `setGradW: float/None` `cancelled: bool/None` `opModStorageTargetW: float/None` | Updates the DefaultDERControl's parameters with the specified values. If `cancelled` is `true`, all unspecified values will be set to None. If `derp_id` is specified, this will apply to the DERProgram with that value, otherwise it will apply to all DERPrograms |
167
+ | `create-der-control` | `start: datetime` `duration_seconds: int` `pow_10_multipliers: int/None` `primacy: int/None` `fsa_id: int/None` `randomizeStart_seconds: int/None` `ramp_time_seconds: float/None` `opModEnergize: bool/None` `opModConnect: bool/None` `opModImpLimW: float/None` `opModExpLimW: float/None` `opModGenLimW: float/None` `opModLoadLimW: float/None` `opModFixedW: float/None` `opModStorageTargetW: float/None` | Creates a DERControl with the specified start/duration and values. A new DERProgram will be created with primacy (and optionally under FunctionSetAssignment `fsa_id`) if no such DERProgram already exists |
168
+ | `create-der-program` | `primacy: int` `fsa_id: int/None` | Creates a DERProgram with the specified primacy. Will be assigned under FunctionSetAssignment 1 unless `fsa_id` says otherwise. |
169
+ | `cancel-active-der-controls` | None | Cancels all active DERControls |
170
+ | `set-comms-rate` | `dcap_poll_seconds: int/None` `edev_post_seconds: int/None` `edev_list_poll_seconds: int/None` `fsa_list_poll_seconds: int/None` `derp_list_poll_seconds: int/None` `der_list_poll_seconds: int/None` `mup_post_seconds: int/None` | Updates one or more post/poll rates for various resources. For non list resources, the rate will apply to all resources. Unspecified values will not update existing server values. |
171
+ | `communications-status` | `enabled: bool` | If `enabled: false` simulates a full outage for the server (from the perspective of the client). There are many potential outage classes (eg: networking, DNS, software, performance issues) - for consistency the recommended outage simulation is for all requests to be served with a HTTP 500. Defaults to `enabled: true` at test start |
172
+ | `edev-registration-links` | `enabled: bool` | If `enabled: false` `EndDevice` entities will NOT encode `RegistrationLink` elements. Defaults to `enabled: true` at test start |
173
+ | `register-end-device` | `nmi: str/None` `registration_pin: int/None` `aggregator_lfdi: HexBinary/None` `aggregator_sfdi: int/None` | Creates a new `EndDevice`, optionally with the specified details. `aggregator_lfdi` / `aggregator_sfdi` will ONLY apply to an Aggregator certificate test with the `aggregator_lfdi` being rewritten with the client's PEN. |
174
+
175
+
176
+ ### Checks
177
+
178
+ A `Check` is a boolean test of the state of the utility server. They are typically defined as a success/failure condition to be run at the end of a `TestProcedure`.
179
+
180
+ `Check`'s are defined with the following schema, always as a list under an element called `checks`
181
+ ```
182
+ checks:
183
+ - type: # string identifier of the check type - see table below
184
+ parameters: # Any parameters to supply to the executed Check - see table below
185
+ ```
186
+
187
+
188
+ This is an example of two `Check` elements that will check that all steps are marked as complete and that there has been a DERStatus submitted with specific values:
189
+
190
+ ```
191
+ checks:
192
+ - type: all-steps-complete
193
+ parameters: {}
194
+ - type: der-status-contents
195
+ parameters:
196
+ genConnectStatus: 1
197
+ ```
198
+
199
+ | **name** | **params** | **description** |
200
+ | -------- | ---------- | --------------- |
201
+ | `all-steps-complete` | `ignored_steps: list[str]/None` | True if every `Step` in a `TestProcedure` has been deactivated (excepting any ignored steps) |
202
+ | `all-notifications-transmitted` | None | True if every transmitted notification (pub/sub) has been received with a HTTP success code response from the subscription notification URI |
203
+ | `end-device-contents` | `has_connection_point_id: bool/None` `deviceCategory_anyset: hex/none` `check_lfdi: bool/None` | True if an `EndDevice` is registered and optionally has the specified contents. `has_connection_point_id` (if True) will check whether the active `EndDevice` has `ConnectionPoint.id` specified. `check_lfdi` will do a deep inspection on the supplied LFDI - checking PEN and derived SFDI. |
204
+ | `der-settings-contents` | `setGradW: int/None` `doeModesEnabled_set: hex/none` `doeModesEnabled_unset: hex/none` `doeModesEnabled: bool/none` `modesEnabled_set: hex/none` `modesEnabled_unset: hex/none` `setMaxVA: bool/none` `setMaxVar: bool/none` `setMaxW: bool/none` `setMaxChargeRateW: bool/none` `setMaxDischargeRateW: bool/none` `setMaxWh: bool/none` `setMinWh: bool/none` `vppModesEnabled_set: hexbinary/none` `vppModesEnabled_unset: hexbinary/none` `setMaxVarNeg: bool/none` `setMinPFOverExcited: bool/none` `setMinPFUnderExcited: bool/none` | True if a `DERSettings` has been set for the `EndDevice` under test (and if certain elements have been set to certain values) |
205
+ | `der-capability-contents` | `doeModesSupported_set: hex/none` `doeModesSupported_unset: hex/none` `doeModesSupported: bool/none` `modesSupported_set: hex/none` `modesSupported_unset: hex/none` `rtgMaxVA: bool/none` `rtgMaxVar: bool/none` `rtgMaxW: bool/none` `rtgMaxChargeRateW: bool/none` `rtgMaxDischargeRateW: bool/none` `rtgMaxWh: bool/none` `vppModesSupported_set: hexbinary/none` `vppModesSupported_unset: hexbinary/none` `rtgMaxVarNeg: bool/none` `rtgMinPFOverExcited: bool/none` `rtgMinPFUnderExcited: bool/none` | True if a `DERCapability` has been set for the `EndDevice` under test (and if certain elements have been set to certain values) |
206
+ | `der-status-contents` | `genConnectStatus: int/None` `operationalModeStatus: int/None` `alarmStatus: int/None` | True if a `DERStatus` has been set for the `EndDevice` under test (and if certain elements have been set to certain values) |
207
+ | `readings-site-active-power` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide active power with `minimum_count` entries and/or readings all above and/or below `minimum_level`/`maximum_level` respectively; optionally for `window_seconds` |
208
+ | `readings-site-reactive-power` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide reactive power with `minimum_count` entries and/or readings all above and/or below `minimum_level`/`maximum_level` respectively; optionally for `window_seconds` |
209
+ | `readings-voltage` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide voltage OR DER voltage with `minimum_count` entries (at least one is required) |
210
+ | `readings-der-active-power` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for DER active power with `minimum_count` entries and/or readings all above and/or below `minimum_level`/`maximum_level` respectively; optionally for `window_seconds` |
211
+ | `readings-der-reactive-power` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for DER reactive power with `minimum_count` entries and/or readings all above and/or below `minimum_level`/`maximum_level` respectively; optionally for `window_seconds` |
212
+ | `response-contents` | `latest: bool/None` `status: int/None` `all: bool/None` | True if at least one received Response matches the filter. `latest` will only consider the most recent received Response. `all` will look for a nominated status match for every `DERControl` |
213
+ | `subscription-contents` | `subscribed_resource: str` | True if a subscription to `subscribed_resource` has been created |
214
+
215
+ The following are csipaus.org/ns/v1.3-beta/storage extension specific checks implemented
216
+
217
+ | **name** | **params** | **description** |
218
+ | -------- | ---------- | --------------- |
219
+ | `readings-der-stored-energy` | `minimum_count: int/none` `minimum_level: float/none` `maximum_level: float/none` `window_seconds: uint/none` | True if any MirrorUsagePoint has a MirrorMeterReading for DER stored energy with `minimum_count` entries and/or readings all above and/or below `minimum_level`/`maximum_level` respectively; optionally for `window_seconds` |
220
+ <br>
221
+
222
+ #### Hexbinary Parameters for Bitwise Operations
223
+ `doeModesEnabled_set` `modesEnabled_set` `doeModesSupported_set` and `modesSupported_set` all expect a hexbinary string to be supplied, which contains the hi assertion bits to be equal to one e.g. `doeModesEnabled_set: "03"` would test to ensure that at least bits 0 and 1 are set hi (==1) for the given `DERSetting.doeModesEnabled`, ignoring all others
224
+ The corresponding `_unset` performs the inverse operation such that every bit set to 1 in the mask is expected to correspond to a zero in the corresponding value e.g. `doeModesEnabled_unset: "03"` would test to ensure that at least bits 0 and 1 are set lo (==0) for the given `DERSetting.doeModesEnabled`, ignoring all others
225
+
226
+ If a common bit is set between a `_set` and `_unset` corresponding pair of parameters, the check will always fail.
227
+
228
+ ### Parameter Variable Resolution
229
+
230
+ Any `parameter` element expects a series of name/value pairs to pass to the "parent" `Action`, `Check` or `Event`. For example:
231
+
232
+ ```
233
+ parameters:
234
+ number_param: 123
235
+ text_param: Text Content
236
+ date_param: 2020-01-02 03:04:05Z
237
+
238
+ ```
239
+
240
+ But placeholder variables may also be used to reference things that aren't known until the test is underway. For example, the following would instead set `number_param` to the current DERSetting.setMaxW supplied by the client while `date_param` would be set to the moment in time that the `Action`, `Check` or `Event` is being evaluated.
241
+
242
+ ```
243
+ parameters:
244
+ number_param: $setMaxW
245
+ text_param: Text Content
246
+ date_param: $now
247
+
248
+ ```
249
+
250
+ The following are all the `NamedVariable` types currently implemented
251
+
252
+ | **name** | **description** |
253
+ | -------- | --------------- |
254
+ | `$now` | Resolves to the current moment in time (timezone aware). Returns a datetime |
255
+ | `$this` | Self reference to a parameter that is supplied as the key for the parameter check. Must have a corresponding NamedVariable that it can resolve to, derived from the key e.g `setMaxW`
256
+ | `$setMaxW` | Resolves to the last supplied value to `DERSetting.setMaxW` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
257
+ | `$setMaxVA` | Resolves to the last supplied value to `DERSetting.setMaxVA` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
258
+ | `$setMaxVar` | Resolves to the last supplied value to `DERSetting.setMaxVar` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
259
+ | `$setMaxChargeRateW` | Resolves to the last supplied value to `DERSetting.setMaxChargeRateW` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
260
+ | `$setMaxDischargeRateW` | Resolves to the last supplied value to `DERSetting.setMaxDischargeRateW` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
261
+ | `$setMaxWh` | Resolves to the last supplied value to `DERSetting.setMaxWh` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail) |
262
+ | `$rtgMaxVA` | Resolves to last supplied `DERCapability.rtgMaxVA` as a number. Raises exceptions if value hasn't been set, causing test to fail.
263
+ | `$rtgMaxVar` | Resolves to last supplied `DERCapability.rtgMaxVar` as a number. Raises exceptions if value hasn't been set, causing test to fail.
264
+ | `$rtgMaxW` | Resolves to last supplied `DERCapability.rtgMaxW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
265
+ | `$rtgMaxChargeRateW` | Resolves to last supplied `DERCapability.rtgMaxChargeRateW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
266
+ | `$rtgMaxDischargeRateW` | Resolves to last supplied `DERCapability.rtgMaxDischargeRateW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
267
+ | `$rtgMaxWh` | Resolves to last supplied `DERCapability.rtgMaxWh` as a number. Raises exceptions if value hasn't been set, causing test to fail.
268
+
269
+ The following are csipaus.org/ns/v1.3-beta/storage extension specific `NamedVariable` types implemented
270
+
271
+ | **name** | **description** |
272
+ | -------- | --------------- |
273
+ | `$setMinWh` | Resolves to the last supplied value to `DERSetting.setMinWh` as a number. Can raise exceptions if this value hasn't been set (which will trigger a test evaluation to fail)
274
+
275
+
276
+ Placeholder variables can also be used in some rudimentary expressions to make variations on the returned value. For example:
277
+
278
+ ```
279
+ parameters:
280
+ number_param: $(setMaxW / 2)
281
+ text_param: Text Content
282
+ date_param: $(now - '5 mins')
283
+ setMaxW: $(this < rtgMaxW)
284
+ setMaxVA: $(this >= rtgMaxWh)
285
+ ```
286
+
287
+ Would resolve similar to above, but instead `number_param` will be half of the last supplied value to `DERSetting.setMaxW` and `date_param` will be set to 5 minutes prior to now.
288
+ `setMaxW` param will return boolean result `DERSettings.setMaxW` is less than `DERCapability.rtgMaxW`.
289
+ `setMaxVA` param will return boolean result `DERSettings.setMaxVA` is greather than or equal to `DERCapability.rtgMaxWh`.
@@ -0,0 +1,139 @@
1
+ cactus_test_definitions/__init__.py,sha256=NPhdd3p_59ej7jOs8axH2HPHJve1-i5CjwOsgSmkBdc,987
2
+ cactus_test_definitions/csipaus.py,sha256=HhBM6scS-Hlz8hFoGct7D2cJOK8NCN6f3CDP72gv7Dk,2864
3
+ cactus_test_definitions/errors.py,sha256=_ZKl42SaEF5c2s9YySJUjGqVCBXSQYOLxpHQhSbNFug,458
4
+ cactus_test_definitions/parameters.py,sha256=FcWvB2UX2MVLYUY8mzGzbFfro3jyLQuoHXzrfoblnic,6727
5
+ cactus_test_definitions/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ cactus_test_definitions/schema.py,sha256=XYMlr2l_pfbyuwXLO88YryjObvxDVEV5IZ2hsThdy2k,736
7
+ cactus_test_definitions/variable_expressions.py,sha256=6oVRj-6lXVKt6zIpSmXpzD2A8ayOWZ2eEpO5_uR6OdE,16741
8
+ cactus_test_definitions/__pycache__/__init__.cpython-312.pyc,sha256=tl4NHHY8MGg0zZI7mT2acj6npHypWiN8TQmR1EG4r8g,941
9
+ cactus_test_definitions/__pycache__/actions.cpython-312.pyc,sha256=XwgSPYeaM1IHOO4g4l2uReYW7WYXmzknaRbwK1ttlh4,5469
10
+ cactus_test_definitions/__pycache__/checks.cpython-312.pyc,sha256=Ql6kMtCPF30vUiwyVIfgvXvflApGgPLhuquTG5TTyos,7434
11
+ cactus_test_definitions/__pycache__/csipaus.cpython-312.pyc,sha256=IdjCebmbzP_BbcuDegjZLU4iNQdX-ZKOLADqdHJdkMw,3177
12
+ cactus_test_definitions/__pycache__/errors.cpython-312.pyc,sha256=60PTb5VQMBsq0Axr7s4zobU2quCKlNndc1YK5gzl8gQ,968
13
+ cactus_test_definitions/__pycache__/events.cpython-312.pyc,sha256=zZ7Y8rX7wgW_9-n0TwGybpDMZrFayHTw0vuYrJPsE6o,3636
14
+ cactus_test_definitions/__pycache__/parameters.cpython-312.pyc,sha256=i1s6vLfuu3hE_mUuzWTfauHz7aOgY7qbgOMA3lNe0hA,7530
15
+ cactus_test_definitions/__pycache__/schema.cpython-312.pyc,sha256=eXiv2zP3S-VBicgjkXBWVOpyYms6fOrEIX7v_SRM0b4,1382
16
+ cactus_test_definitions/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc,sha256=7uF3CT2lJ9QIg8wg0g1O7IB7H9mk8Iz948KqVL_sRpk,14575
17
+ cactus_test_definitions/__pycache__/test_procedures.cpython-312.pyc,sha256=HZMycfqi6VDsU1zU-5hxRqS9-ybPCcI8dPBoiywawtg,13179
18
+ cactus_test_definitions/__pycache__/variable_expressions.cpython-312.pyc,sha256=lmXedMpO0TYdzE2yb6K9N92nEMhui6AMLBRzgpI8vFQ,19260
19
+ cactus_test_definitions/__pycache__/version.cpython-312.pyc,sha256=MYqjwvU2QmzT5lHqXLMdvVg1hQ9eN0gLQnluRgpLn0M,624
20
+ cactus_test_definitions/client/__init__.py,sha256=4g8AUQf_f0g0omguSucSdSMOD0DX5E1cPQiI2R8tQcw,708
21
+ cactus_test_definitions/client/actions.py,sha256=tJNNVmK_itcXPgHxewBZvUsw3u0WK67S5zliULGForI,4924
22
+ cactus_test_definitions/client/checks.py,sha256=kRjAHweUho8g_PrcdDWy5DecnYi9DYPUeZ66ymN2504,7603
23
+ cactus_test_definitions/client/events.py,sha256=-EjfwHyrqjtEdT6VU19GqBrL79MDulEzk2uBzXGHSS0,3097
24
+ cactus_test_definitions/client/test_procedures.py,sha256=MjDQZchsnNATwTp1DK860W_WPXDv3Pn8nhXCaNsDjAQ,6521
25
+ cactus_test_definitions/client/validate.py,sha256=0zXIfL57lllaxwS1Qk0jnSpSnxKBA95Xz5N_CwjENsA,4194
26
+ cactus_test_definitions/client/__pycache__/__init__.cpython-312.pyc,sha256=iGBIfS-Qbf1CDzMWspMLQtEn4Y-W_ZFlZvDJLXCa2Ys,793
27
+ cactus_test_definitions/client/__pycache__/actions.cpython-312.pyc,sha256=nmXKfZ2vRrsjmPjEjLN_eII4a-QxLhCh-A4K8yzHrEA,5476
28
+ cactus_test_definitions/client/__pycache__/checks.cpython-312.pyc,sha256=iOgmSudlwvWqkcI41ygANGU6qNnGLLf5Mh3NS94RHg8,7758
29
+ cactus_test_definitions/client/__pycache__/events.cpython-312.pyc,sha256=wST_41dRBpS8kfn94RIrDngaARJk8EUflcM9JoHZyFE,3649
30
+ cactus_test_definitions/client/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc,sha256=WD7_Dt-Q1FZRoPXiXcVcjAoxTJCVUIzAGRIgUkF4bys,8011
31
+ cactus_test_definitions/client/__pycache__/validate.cpython-312.pyc,sha256=hEP-rVMhlg7lZjFMN8qkhzF5phUxGwWDFNHjJFjxYCs,4839
32
+ cactus_test_definitions/client/procedures/ALL-01.yaml,sha256=2RdNwqHMo-otjMEOoIwWgjOaTfj7_dRWfV2HGKMGQ-s,2246
33
+ cactus_test_definitions/client/procedures/ALL-02.yaml,sha256=oc4P8zd-J6pvVqaJqSSfaBYKP1mSu_9iCGYYhw2W9K4,2555
34
+ cactus_test_definitions/client/procedures/ALL-03-REJ.yaml,sha256=TZcKMZqJmRwnsrBA9mhcngmVVJ9PCSVfmbAF4_2EOxQ,1924
35
+ cactus_test_definitions/client/procedures/ALL-03.yaml,sha256=Qer-pPxkhbtTnlpbcgyBC59RB9IR_lHQ2U7idbWtFL8,2215
36
+ cactus_test_definitions/client/procedures/ALL-04.yaml,sha256=pnfXRcu2H1q4xXZymXQFGf9qf4Q1ZMpoj2K6hP2U45c,1852
37
+ cactus_test_definitions/client/procedures/ALL-05.yaml,sha256=pSAMbxax1UmAw3lG9jSSL0T-X79XhVdjoEE7hQ4R7Rg,2584
38
+ cactus_test_definitions/client/procedures/ALL-06.yaml,sha256=-RAihWv3V1lRAl6f9ugVGgLfef5mR3kQNpxuzXjK-CI,3251
39
+ cactus_test_definitions/client/procedures/ALL-07.yaml,sha256=vXxOevhlvhcStPIbYpXf28WEYOkWhHfkNPWbXHK2MZw,1860
40
+ cactus_test_definitions/client/procedures/ALL-08.yaml,sha256=Zv-XzXo0i6neHQemDUBLJY0ullYjID7Oa-oJOQd1Y4A,2059
41
+ cactus_test_definitions/client/procedures/ALL-09.yaml,sha256=Lctd1xBlnA7c3GzA0069VtE5gB2X1fw8VeBkFXf5hxU,3538
42
+ cactus_test_definitions/client/procedures/ALL-10.yaml,sha256=slSJz4w7lBDSjPk1ke0Q_Cxmj3rj19SzdOdF1AKat6M,2955
43
+ cactus_test_definitions/client/procedures/ALL-11.yaml,sha256=SBVmwlETTdMeXpf3HxqGfE_GBQZ3bzTrlWZuePP0TiM,2715
44
+ cactus_test_definitions/client/procedures/ALL-12.yaml,sha256=F8MezGzOS6Ww93dpEkKkkwrnxTG9LqVVAeCv352iXQs,2636
45
+ cactus_test_definitions/client/procedures/ALL-13.yaml,sha256=zLcYjyGlzP_skboCp8MHEOzxNgAlmhGL7A2Zy91jjcA,2775
46
+ cactus_test_definitions/client/procedures/ALL-14.yaml,sha256=4JMnmleJ77dtIdhNUeHjihaq6UUMsk4o42lcv8xe3Us,4948
47
+ cactus_test_definitions/client/procedures/ALL-15.yaml,sha256=pT07akLV1xl66r-NISqHy8D8eSbbqwesNXFxAKJ5Oek,2969
48
+ cactus_test_definitions/client/procedures/ALL-16.yaml,sha256=2XVey8zFvgNDEd3Jz5g_mmz10Q8yhmJW4iVs2IF3tnk,2796
49
+ cactus_test_definitions/client/procedures/ALL-17.yaml,sha256=4I0588Fl7FsVK23GfcPYWSozCBKXFLRNxBD1ORHglVc,1687
50
+ cactus_test_definitions/client/procedures/ALL-18.yaml,sha256=_5SBF6G3eA6wUm89aMXvBcuuBdjKGLDkbTU7M1EuZ8Q,6955
51
+ cactus_test_definitions/client/procedures/ALL-19.yaml,sha256=V9bFWAfkWKdqLpCSnapWTuEvLWAGK2gEOpjVKFpOBZg,1493
52
+ cactus_test_definitions/client/procedures/ALL-20.yaml,sha256=SHJyX6_HvplWhQKgwKMvNFFH8Ox53JEiupWWkLkhOVM,2873
53
+ cactus_test_definitions/client/procedures/ALL-21.yaml,sha256=sYCsjrGlFVnAXxyAmMBWmX9P_VnoFfj7o8scyB_oKwc,5929
54
+ cactus_test_definitions/client/procedures/ALL-22.yaml,sha256=X18P3DUlfv2w60iz1PmsOUXBMuvUUI7cPBLy-hC1-GU,2128
55
+ cactus_test_definitions/client/procedures/ALL-23.yaml,sha256=hIiufcCmhCdGBOqH3eKZlMeFIUziIZYpKC0x6thuQjA,3838
56
+ cactus_test_definitions/client/procedures/ALL-24.yaml,sha256=b_oyCXia0twYwj6NxXvevBB5JJRUADgL40EdikRRgR4,3189
57
+ cactus_test_definitions/client/procedures/ALL-25-EXT.yaml,sha256=jtG0jQiLN5KJmB2IpJ9uCpSfX314zD6y21lEDnBRMH0,6838
58
+ cactus_test_definitions/client/procedures/ALL-25.yaml,sha256=ojLqgzDGxF9-TnXUiZHC1PKaVw5Jj-RNBx0BDWjzpOc,3213
59
+ cactus_test_definitions/client/procedures/ALL-26.yaml,sha256=KKuWDpsEGdUM7F4aJ_QRwvug11nrKqRCPyvxeAaQNWE,3654
60
+ cactus_test_definitions/client/procedures/ALL-27.yaml,sha256=HIzw1VjCDrgdeLGUPpbZ8Xx0H12wyA00O4I42BYGOuI,3524
61
+ cactus_test_definitions/client/procedures/ALL-28.yaml,sha256=HuyVHRW-sYN_gFtFXyEgfONKLS4ZzWD_YC3B5WNePYo,6678
62
+ cactus_test_definitions/client/procedures/ALL-29.yaml,sha256=bHOKU-rhwgqYsFZs2SOlj8iArbv0-OV_M691KTSCE_A,2373
63
+ cactus_test_definitions/client/procedures/ALL-30.yaml,sha256=rMPdG3VJ8_i6hWAh3OCEun0a3CNnQwqO7DZLPDYLf9g,4714
64
+ cactus_test_definitions/client/procedures/BES-01.yaml,sha256=Cyee2mlhsB5bXzlQPGRDTBMsifQvcPc216ePHrMPPj4,3185
65
+ cactus_test_definitions/client/procedures/BES-02.yaml,sha256=a1VQ1e4r4fO6LqlV6-ivIdg0S_0vgSTcSs8lB3RRZkk,3154
66
+ cactus_test_definitions/client/procedures/BES-03.yaml,sha256=Sem23i5kkegx7UFAd8Qy4p6qXcLTQdiVRGhbMkWEtIc,3315
67
+ cactus_test_definitions/client/procedures/BES-04.yaml,sha256=Xp9tCaXvskhtIuUvsuBZoGoCWHTrCEC6McqCEbqQoMo,5854
68
+ cactus_test_definitions/client/procedures/DRA-01.yaml,sha256=jVR0y58T7rqh363pN1HBrLtp84J58WiEep8E3aY3UoY,1246
69
+ cactus_test_definitions/client/procedures/DRA-02.yaml,sha256=ju_PPKe83g5C0H1PDsMgZa_TGHIyeRO-J78fxKpgm20,1396
70
+ cactus_test_definitions/client/procedures/DRD-01.yaml,sha256=w_-hbwNRfQqm_i_AAOlVe24ZYFCFye6BknDDnN8Kfkc,16257
71
+ cactus_test_definitions/client/procedures/DRL-01.yaml,sha256=Yz7U8oZnTFc8Rb-TZgX1vzUFMtoFsgBwFNGSTSSuuJw,7818
72
+ cactus_test_definitions/client/procedures/GEN-01.yaml,sha256=z0NHCjyO5sZZl3C8f5pEe0zgZdaP0RfBQSgaaKAaYm4,1588
73
+ cactus_test_definitions/client/procedures/GEN-02.yaml,sha256=0v2S1120FrR2LuI3shZO3sHCKxI_iK13JOWawFlzqsQ,1579
74
+ cactus_test_definitions/client/procedures/GEN-03.yaml,sha256=sg_OSAiOsHx3v6GaWpQ0vsUd-wqu5O_76lJdQeZWdtE,4264
75
+ cactus_test_definitions/client/procedures/GEN-04.yaml,sha256=84GpwRnInstPytQ--oPwxF2o68-1n4mcHE7p7ilf7rI,4254
76
+ cactus_test_definitions/client/procedures/GEN-05.yaml,sha256=l0X9cpynooHXFs7L2LEb3jRd3jdI8fG0pt1Ldb3cMik,2338
77
+ cactus_test_definitions/client/procedures/GEN-06.yaml,sha256=lI0rdSpoMxEUTpBgur6mWj4lYODdBrSC67fl1-gWfwY,2320
78
+ cactus_test_definitions/client/procedures/GEN-07.yaml,sha256=ij4yLjZlWys7kkfgaEiA907db0gPjODpeGBf8u_FGjE,3834
79
+ cactus_test_definitions/client/procedures/GEN-08.yaml,sha256=IxOtwAJMuvGwLDaFa-h2mR_jeeUo6tzmPi13ToOsxnY,3810
80
+ cactus_test_definitions/client/procedures/GEN-09.yaml,sha256=_UCMImEyS4j64g17uv1Zo1a6XXQvyAQfaABApEOFVSc,2738
81
+ cactus_test_definitions/client/procedures/GEN-10.yaml,sha256=PkkapsTLwJ4w_oJoOze4cGRfUHd8PFyVvaWu2-cQROY,18368
82
+ cactus_test_definitions/client/procedures/GEN-11.yaml,sha256=chZyiplPJMWjpItLHgNFBL_Q48bQmdJtH4hOqbuBrzE,9571
83
+ cactus_test_definitions/client/procedures/GEN-12.yaml,sha256=CoWOVHi1AUnV0yQJnECpk2LfdqFbbYLiCBjcZHADWMs,9575
84
+ cactus_test_definitions/client/procedures/GEN-13.yaml,sha256=W_l7RRgyUjA86iU3ZEY5R8kcmRpGYjdh-QXlnS4vLNg,1944
85
+ cactus_test_definitions/client/procedures/LOA-01.yaml,sha256=VYEHZjCBXuwYqwZT7RnJrMn8cZdAZJ8cOe8hRrx_Q_c,1592
86
+ cactus_test_definitions/client/procedures/LOA-02.yaml,sha256=27YRxcD1_TN8rAbKEh86_aIYM6856SKSBQYRVLPdetI,1591
87
+ cactus_test_definitions/client/procedures/LOA-03.yaml,sha256=seYSqDjEck3oquzacZbgZQRMq6_mhA1TrrrHSlZHMqc,4264
88
+ cactus_test_definitions/client/procedures/LOA-04.yaml,sha256=mSEBWuPPNHIc3EuS8h1Z3D1lcwwA00d6RP6XhfxzeBk,4243
89
+ cactus_test_definitions/client/procedures/LOA-05.yaml,sha256=qvccpkyZkYfxHA7ucJ8wJvFcG249WSUS8LewoLiZ0rE,2349
90
+ cactus_test_definitions/client/procedures/LOA-06.yaml,sha256=k6VKYZXP1RWnIxYCk190jq6Jo4Ho1xHupYefWZUhEcM,2315
91
+ cactus_test_definitions/client/procedures/LOA-07.yaml,sha256=oMGudpytVstjt7px6ELF5o1mYZGWpImz7XpgLeansq8,3836
92
+ cactus_test_definitions/client/procedures/LOA-08.yaml,sha256=gOpizgOqDHDq6naatEZyqXCpSI7ZZXljvdA6v6sxHbY,3809
93
+ cactus_test_definitions/client/procedures/LOA-09.yaml,sha256=Iiwr4RSho8v9ScoNa4gwasGRrqUGv--TbCXuKieTsvo,2738
94
+ cactus_test_definitions/client/procedures/LOA-10.yaml,sha256=Lpq7pNImV76YlkywMt27qgYUZsAE5y1ruzdmOhVrlwU,18378
95
+ cactus_test_definitions/client/procedures/LOA-11.yaml,sha256=6FEnkKAVEn7tC_MQc9kROkm18bYH6nSepjQ4XNALsBE,9571
96
+ cactus_test_definitions/client/procedures/LOA-12.yaml,sha256=TuXdiDVX0X_tM4zwIJsinfB2YhCPBz7f1IjRONfSpNQ,9574
97
+ cactus_test_definitions/client/procedures/LOA-13.yaml,sha256=l7iSWNKy-Lkii7GEfdD2qP7KjXa2IX5TI7cGArMzB6o,1945
98
+ cactus_test_definitions/client/procedures/MUL-01.yaml,sha256=Gr2HhsfbWqZSlCBproJiNaa3sltynIwbC5UbmVTTjLw,2575
99
+ cactus_test_definitions/client/procedures/MUL-02.yaml,sha256=WENhaE0PFb6cifMi3cWyF2YDM0ZnGD2VT9nVgYzqvd8,2239
100
+ cactus_test_definitions/client/procedures/MUL-03.yaml,sha256=XZ9UJXuBGzTg5IB8LeFaf2CTDRT7HwRHRCvwyyRTCY4,1814
101
+ cactus_test_definitions/server/README.md,sha256=KgmQQ5Wu1zDl-c4vAXjsmpC_hy6Kux43a_seLaUbb10,10718
102
+ cactus_test_definitions/server/__init__.py,sha256=Fr7eJNOlo35wzMU9KZT4AdNbM8sbc7YYo09TldmBIPI,585
103
+ cactus_test_definitions/server/actions.py,sha256=NaA3t0AIAkfjgn7BUN8H0oGTLpADyNgukr-CFqYvrB8,8196
104
+ cactus_test_definitions/server/checks.py,sha256=JTNkeekv6J-haSsbLYXjtFRrCkivQceK8zFVoADJdbY,6980
105
+ cactus_test_definitions/server/test_procedures.py,sha256=zUocQAhjd30n2QMVXSO6WgPt97WzYz8EoZi4XZl6X0c,5023
106
+ cactus_test_definitions/server/validate.py,sha256=mNXPfzpB-k0xyOtKT67b_wgjyV3D6OiLnAXG88pNLrI,1324
107
+ cactus_test_definitions/server/__pycache__/__init__.cpython-312.pyc,sha256=JdDVXCdd54U4rqNT8bv5Q9dJBH8ev1N-TWARcE5pDh0,682
108
+ cactus_test_definitions/server/__pycache__/actions.cpython-312.pyc,sha256=juUpedMctwwK0xAzgyAiYD6loOywteHL1xs2Yaeacwg,6310
109
+ cactus_test_definitions/server/__pycache__/checks.cpython-312.pyc,sha256=e88BjRuT0urt_W6VKhSky5s0oJa7rC6yWVvK99elwEY,5542
110
+ cactus_test_definitions/server/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc,sha256=IMY_IA9WuSG22Lcj0_RnzOTlM7Ya2iQEH04vyIR6w4g,6122
111
+ cactus_test_definitions/server/__pycache__/validate.cpython-312.pyc,sha256=I4jcKJewefCFjDNQdtpEMkpIClHbNKYxjyQBgKkAyhU,1839
112
+ cactus_test_definitions/server/procedures/S-ALL-01.yaml,sha256=p5TTsxdk__zsGmki0bggxFa2utqjgelv-5oakUxRIZw,844
113
+ cactus_test_definitions/server/procedures/S-ALL-02.yaml,sha256=dAId6vNhHCHF1jdCGcO5xxs5d5RenAXaH-XrMpNNQ_k,1494
114
+ cactus_test_definitions/server/procedures/S-ALL-03.yaml,sha256=gzNHYyUa0C3iYdQAL-4xRgbejd-7xIYgekWuyPBUJ-U,1502
115
+ cactus_test_definitions/server/procedures/S-ALL-04.yaml,sha256=lNB9yFRcV1jtbnvXU-MZhY68YVitTV1hKlvImNyDpuU,3247
116
+ cactus_test_definitions/server/procedures/S-ALL-05.yaml,sha256=-p_9-yl--RG2HQAh02xYhP1k78XQ1z45Pc_hkbD-35c,2509
117
+ cactus_test_definitions/server/procedures/S-OPT-01.yaml,sha256=p1XYhKBFoUa1VrJyxhnd4Bm762tkjkpvvyd8oApo14I,909
118
+ cactus_test_definitions/server/procedures/S-OPT-02.yaml,sha256=jMoMRo_vgfaB9yoY9LHI8jTtGrfqttGHqRTV2lihAcc,883
119
+ cactus_test_definitions/server/procedures/S-OPT-03.yaml,sha256=tOzDTOE9D-CWT61RuWRTDGcpt7W57NcH9_eZvQyLhFs,980
120
+ cactus_test_definitions/server/procedures/S-OPT-04.yaml,sha256=o33HNLTzxQm__KbFW1x2ce04uW-xx6Li0aijJI_XbYQ,667
121
+ cactus_test_definitions-1.6.0.dist-info/licenses/LICENSE.txt,sha256=xCq-ofiZHRqQJHkhY1M-eXahPozfXmo9qvez6BiCOdk,1074
122
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
123
+ tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
124
+ tests/unit/test_csipaus.py,sha256=edFnWDlHgMuW7CK9l8z-FHA1GcIACVJ1RPERiFuWfcY,1959
125
+ tests/unit/test_parameters.py,sha256=FqkJtC2Tct9hbuznzzsNyomvmZ24Q3RS2B_tfK0-T5M,8484
126
+ tests/unit/test_variable_expressions.py,sha256=HTeEcLiJPmMREJs4mOfR0Q48l8E-XYyQgISn5XLW2BU,15969
127
+ tests/unit/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
+ tests/unit/client/test_actions.py,sha256=pIVprTLPpD4mGkmORArIEKuoFShzWleakqEZHDGV4rQ,3172
129
+ tests/unit/client/test_checks.py,sha256=Al91dwToyn_1LGjb2dVLNjHAOcGfXwK_GTr0dVOzKsI,3417
130
+ tests/unit/client/test_events.py,sha256=bXDW0Ykx9hqh8MLv1b_9a942LahlhE3L2pu7NyGsdRo,1550
131
+ tests/unit/client/test_test_procedures.py,sha256=hXB8C4ijt7FGqfoz7sQ9xXcyB-gRAbPj0-7tIb0fL6w,3889
132
+ tests/unit/client/test_validate.py,sha256=j2E6sUFK7zv13VITE3IenyF4WE2Z4-P4ZCxiJHrTzzQ,6758
133
+ tests/unit/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
+ tests/unit/server/test_test_procedures.py,sha256=XNcMnV14DSbIdIVGDnYszfqg_xDDdABI9rux4HKAfKI,2167
135
+ tests/unit/server/test_validate.py,sha256=ZW3YJGY8oKbsKneOL_gRQXUNgVWZYTgJdo8ICjJfXlw,3033
136
+ cactus_test_definitions-1.6.0.dist-info/METADATA,sha256=4wUo3wDd0qcBqY9aM5DJAok7XahQOzBZUGvjSRi36zo,22410
137
+ cactus_test_definitions-1.6.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
138
+ cactus_test_definitions-1.6.0.dist-info/top_level.txt,sha256=4tQTXLPjTzH6OYZqOj40IX8XgosTUTUEJTESjtj0KfI,30
139
+ cactus_test_definitions-1.6.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.9.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2024
4
+
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the “Software”), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ cactus_test_definitions
2
+ tests
tests/__init__.py ADDED
File without changes
tests/unit/__init__.py ADDED
File without changes
File without changes
@@ -0,0 +1,72 @@
1
+ from datetime import datetime
2
+
3
+ import pytest
4
+ from cactus_test_definitions import variable_expressions as varexps
5
+ from cactus_test_definitions.client.actions import (
6
+ Action,
7
+ validate_action_parameters,
8
+ )
9
+ from cactus_test_definitions.errors import TestProcedureDefinitionError
10
+
11
+
12
+ @pytest.mark.parametrize(
13
+ "action, is_valid",
14
+ [
15
+ (Action("foo", {}), False),
16
+ (Action("enable-steps", {"steps": []}), True),
17
+ (Action("enable-steps", {"steps": ["other-step"]}), True),
18
+ (Action("enable-steps", {"steps": ["other-step"], "unused-param": 123}), False), # extra param
19
+ (Action("set-default-der-control", {}), True),
20
+ (Action("set-default-der-control", {"opModImpLimW": 12.3, "opModExpLimW": 14}), True),
21
+ # storage extension specific
22
+ (
23
+ Action("set-default-der-control", {"opModImpLimW": 12.3, "opModExpLimW": 14, "opModStorageTargetW": 200}),
24
+ True,
25
+ ),
26
+ (Action("set-default-der-control", {"opModImpLimW": 12.3, "opModExpLimW": "Invalid"}), False), # bad type
27
+ (Action("create-der-control", {"start": datetime(2022, 1, 3)}), False), # Missing duration_seconds
28
+ (Action("create-der-control", {"start": datetime(2022, 1, 3), "duration_seconds": 123}), True),
29
+ # storage extension specific
30
+ (
31
+ Action(
32
+ "create-der-control",
33
+ {"start": datetime(2022, 1, 3), "duration_seconds": 123, "opModStorageTargetW": 1.5},
34
+ ),
35
+ True,
36
+ ),
37
+ ],
38
+ )
39
+ def test_validate_action_parameters(action: Action, is_valid: bool):
40
+ if is_valid:
41
+ validate_action_parameters("foo", "bar", action)
42
+ else:
43
+ with pytest.raises(TestProcedureDefinitionError):
44
+ validate_action_parameters("foo", "bar", action)
45
+
46
+
47
+ def test_action_expression() -> None:
48
+ """Tests the creation of an Action that has an expression as one of its parameters"""
49
+ type_str = "some_action"
50
+ params = {"setMaxW": "$(this == rtgMaxW)"}
51
+ action = Action(type_str, params)
52
+
53
+ check_set_max_w = action.parameters["setMaxW"]
54
+ assert isinstance(check_set_max_w, varexps.Expression)
55
+ assert check_set_max_w.operation == varexps.OperationType.EQ
56
+ assert check_set_max_w.lhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERSETTING_SET_MAX_W)
57
+ assert check_set_max_w.rhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERCAPABILITY_RTG_MAX_W)
58
+
59
+
60
+ def test_action_expression_using_storage_extension() -> None:
61
+ """Tests the creation of an Action that has an expression as one of its parameters.
62
+
63
+ Using storage extension params."""
64
+ type_str = "some_action"
65
+ params = {"setMinWh": "$(this <= setMaxWh)"}
66
+ action = Action(type_str, params)
67
+
68
+ check_set_min_wh = action.parameters["setMinWh"]
69
+ assert isinstance(check_set_min_wh, varexps.Expression)
70
+ assert check_set_min_wh.operation == varexps.OperationType.LTE
71
+ assert check_set_min_wh.lhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERSETTING_SET_MIN_WH)
72
+ assert check_set_min_wh.rhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERSETTING_SET_MAX_WH)
@@ -0,0 +1,71 @@
1
+ import pytest
2
+ from cactus_test_definitions import variable_expressions as varexps
3
+ from cactus_test_definitions.client.checks import Check, validate_check_parameters
4
+ from cactus_test_definitions.errors import TestProcedureDefinitionError
5
+
6
+
7
+ @pytest.mark.parametrize(
8
+ "check, is_valid",
9
+ [
10
+ (Check("foo", {}), False), # Unknown check
11
+ (Check("readings-site-active-power", {}), True),
12
+ (Check("readings-site-active-power", {"minimum_count": "3"}), False),
13
+ (Check("readings-site-active-power", {"minimum_count": 3}), True),
14
+ (Check("readings-site-active-power", {"minimum_count": 3, "minimum_level": 12.3}), True),
15
+ (Check("readings-site-active-power", {"minimum_count": 3, "maximum_level": 12.3}), True),
16
+ (Check("readings-site-active-power", {"minimum_count": 3, "minimum_level": 12.3, "maximum_level": 12.3}), True),
17
+ (
18
+ Check(
19
+ "readings-site-active-power",
20
+ {"minimum_count": 3, "minimum_level": 12.3, "maximum_level": 12.3, "window_seconds": 12.3},
21
+ ),
22
+ False,
23
+ ),
24
+ (
25
+ Check(
26
+ "readings-site-active-power",
27
+ {"minimum_count": 3, "minimum_level": 12.3, "maximum_level": 12.3, "window_seconds": 180},
28
+ ),
29
+ True,
30
+ ),
31
+ (
32
+ Check(
33
+ "readings-site-active-power",
34
+ {"minimum_count": 3, "minimum_level": 12.3, "maximum_level": 12.3, "window_seconds": -180},
35
+ ),
36
+ False,
37
+ ),
38
+ (Check("der-settings-contents", {"setGradW": 27}), True),
39
+ (Check("der-settings-contents", {"doeModesEnabled_set": "0f"}), True),
40
+ (Check("der-settings-contents", {"doeModesEnabled_unset": "0f"}), True),
41
+ (Check("der-settings-contents", {"modesEnabled_set": "E"}), True),
42
+ (Check("der-settings-contents", {"modesEnabled_unset": "E"}), True),
43
+ (Check("der-settings-contents", {"doeModesEnabled_set": 12}), False),
44
+ (Check("der-settings-contents", {"doeModesEnabled_unset": 12}), False),
45
+ # Storage extension
46
+ (Check("der-settings-contents", {"vppModesEnabled_set": "1"}), True),
47
+ (Check("der-settings-contents", {"vppModesEnabled_unset": "1"}), True),
48
+ (Check("der-capability-contents", {"vppModesSupported_set": "1"}), True),
49
+ (Check("der-capability-contents", {"vppModesSupported_unset": "1"}), True),
50
+ (Check("readings-der-stored-energy", {"minimum_count": 3}), True),
51
+ ],
52
+ )
53
+ def test_validate_check_parameters(check: Check, is_valid: bool):
54
+ if is_valid:
55
+ validate_check_parameters("foo", check)
56
+ else:
57
+ with pytest.raises(TestProcedureDefinitionError):
58
+ validate_check_parameters("foo", check)
59
+
60
+
61
+ def test_check_expression() -> None:
62
+ """Tests the creation of a Check that has an expression as one of its parameters"""
63
+ type_str = "some_check"
64
+ params = {"setMaxW": "$(this < rtgMaxW)"}
65
+ check = Check(type_str, params)
66
+
67
+ check_set_max_w = check.parameters["setMaxW"]
68
+ assert isinstance(check_set_max_w, varexps.Expression)
69
+ assert check_set_max_w.operation == varexps.OperationType.LT
70
+ assert check_set_max_w.lhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERSETTING_SET_MAX_W)
71
+ assert check_set_max_w.rhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERCAPABILITY_RTG_MAX_W)