cactus-test-definitions 1.0.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 (135) 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/actions.py +98 -0
  21. cactus_test_definitions/client/checks.py +117 -0
  22. cactus_test_definitions/client/events.py +71 -0
  23. cactus_test_definitions/client/procedures/ALL-01.yaml +94 -0
  24. cactus_test_definitions/client/procedures/ALL-02.yaml +108 -0
  25. cactus_test_definitions/client/procedures/ALL-03-REJ.yaml +69 -0
  26. cactus_test_definitions/client/procedures/ALL-03.yaml +110 -0
  27. cactus_test_definitions/client/procedures/ALL-04.yaml +69 -0
  28. cactus_test_definitions/client/procedures/ALL-05.yaml +117 -0
  29. cactus_test_definitions/client/procedures/ALL-06.yaml +128 -0
  30. cactus_test_definitions/client/procedures/ALL-07.yaml +76 -0
  31. cactus_test_definitions/client/procedures/ALL-08.yaml +78 -0
  32. cactus_test_definitions/client/procedures/ALL-09.yaml +103 -0
  33. cactus_test_definitions/client/procedures/ALL-10.yaml +128 -0
  34. cactus_test_definitions/client/procedures/ALL-11.yaml +111 -0
  35. cactus_test_definitions/client/procedures/ALL-12.yaml +108 -0
  36. cactus_test_definitions/client/procedures/ALL-13.yaml +112 -0
  37. cactus_test_definitions/client/procedures/ALL-14.yaml +165 -0
  38. cactus_test_definitions/client/procedures/ALL-15.yaml +109 -0
  39. cactus_test_definitions/client/procedures/ALL-16.yaml +102 -0
  40. cactus_test_definitions/client/procedures/ALL-17.yaml +63 -0
  41. cactus_test_definitions/client/procedures/ALL-18.yaml +288 -0
  42. cactus_test_definitions/client/procedures/ALL-19.yaml +78 -0
  43. cactus_test_definitions/client/procedures/ALL-20.yaml +136 -0
  44. cactus_test_definitions/client/procedures/ALL-21.yaml +203 -0
  45. cactus_test_definitions/client/procedures/ALL-22.yaml +82 -0
  46. cactus_test_definitions/client/procedures/ALL-23.yaml +158 -0
  47. cactus_test_definitions/client/procedures/ALL-24.yaml +132 -0
  48. cactus_test_definitions/client/procedures/ALL-25.yaml +136 -0
  49. cactus_test_definitions/client/procedures/ALL-26.yaml +147 -0
  50. cactus_test_definitions/client/procedures/ALL-27.yaml +144 -0
  51. cactus_test_definitions/client/procedures/ALL-28.yaml +274 -0
  52. cactus_test_definitions/client/procedures/ALL-29.yaml +87 -0
  53. cactus_test_definitions/client/procedures/ALL-30.yaml +188 -0
  54. cactus_test_definitions/client/procedures/BES-01.yaml +136 -0
  55. cactus_test_definitions/client/procedures/BES-02.yaml +137 -0
  56. cactus_test_definitions/client/procedures/BES-03.yaml +135 -0
  57. cactus_test_definitions/client/procedures/BES-04.yaml +228 -0
  58. cactus_test_definitions/client/procedures/DRA-01.yaml +54 -0
  59. cactus_test_definitions/client/procedures/DRA-02.yaml +64 -0
  60. cactus_test_definitions/client/procedures/DRD-01.yaml +667 -0
  61. cactus_test_definitions/client/procedures/DRL-01.yaml +327 -0
  62. cactus_test_definitions/client/procedures/GEN-01.yaml +73 -0
  63. cactus_test_definitions/client/procedures/GEN-02.yaml +72 -0
  64. cactus_test_definitions/client/procedures/GEN-03.yaml +160 -0
  65. cactus_test_definitions/client/procedures/GEN-04.yaml +161 -0
  66. cactus_test_definitions/client/procedures/GEN-05.yaml +89 -0
  67. cactus_test_definitions/client/procedures/GEN-06.yaml +90 -0
  68. cactus_test_definitions/client/procedures/GEN-07.yaml +145 -0
  69. cactus_test_definitions/client/procedures/GEN-08.yaml +145 -0
  70. cactus_test_definitions/client/procedures/GEN-09.yaml +117 -0
  71. cactus_test_definitions/client/procedures/GEN-10.yaml +737 -0
  72. cactus_test_definitions/client/procedures/GEN-11.yaml +376 -0
  73. cactus_test_definitions/client/procedures/GEN-12.yaml +376 -0
  74. cactus_test_definitions/client/procedures/GEN-13.yaml +70 -0
  75. cactus_test_definitions/client/procedures/LOA-01.yaml +73 -0
  76. cactus_test_definitions/client/procedures/LOA-02.yaml +73 -0
  77. cactus_test_definitions/client/procedures/LOA-03.yaml +160 -0
  78. cactus_test_definitions/client/procedures/LOA-04.yaml +161 -0
  79. cactus_test_definitions/client/procedures/LOA-05.yaml +85 -0
  80. cactus_test_definitions/client/procedures/LOA-06.yaml +85 -0
  81. cactus_test_definitions/client/procedures/LOA-07.yaml +145 -0
  82. cactus_test_definitions/client/procedures/LOA-08.yaml +145 -0
  83. cactus_test_definitions/client/procedures/LOA-09.yaml +117 -0
  84. cactus_test_definitions/client/procedures/LOA-10.yaml +739 -0
  85. cactus_test_definitions/client/procedures/LOA-11.yaml +376 -0
  86. cactus_test_definitions/client/procedures/LOA-12.yaml +376 -0
  87. cactus_test_definitions/client/procedures/LOA-13.yaml +71 -0
  88. cactus_test_definitions/client/procedures/MUL-01.yaml +92 -0
  89. cactus_test_definitions/client/procedures/MUL-02.yaml +80 -0
  90. cactus_test_definitions/client/procedures/MUL-03.yaml +78 -0
  91. cactus_test_definitions/client/procedures/OPT-1-IN-BAND.yaml +115 -0
  92. cactus_test_definitions/client/procedures/OPT-1-OUT-OF-BAND.yaml +101 -0
  93. cactus_test_definitions/client/procedures/test-procedures.yaml +75 -0
  94. cactus_test_definitions/client/test_procedures.py +296 -0
  95. cactus_test_definitions/csipaus.py +81 -0
  96. cactus_test_definitions/errors.py +15 -0
  97. cactus_test_definitions/parameters.py +149 -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/__pycache__/actions.cpython-312.pyc +0 -0
  102. cactus_test_definitions/server/__pycache__/checks.cpython-312.pyc +0 -0
  103. cactus_test_definitions/server/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc +0 -0
  104. cactus_test_definitions/server/actions.py +139 -0
  105. cactus_test_definitions/server/checks.py +117 -0
  106. cactus_test_definitions/server/procedures/S-ALL-01.yaml +42 -0
  107. cactus_test_definitions/server/procedures/S-ALL-02.yaml +65 -0
  108. cactus_test_definitions/server/procedures/S-ALL-03.yaml +65 -0
  109. cactus_test_definitions/server/procedures/S-ALL-04.yaml +137 -0
  110. cactus_test_definitions/server/procedures/S-ALL-05.yaml +111 -0
  111. cactus_test_definitions/server/procedures/S-OPT-01.yaml +42 -0
  112. cactus_test_definitions/server/procedures/S-OPT-02.yaml +40 -0
  113. cactus_test_definitions/server/procedures/S-OPT-03.yaml +44 -0
  114. cactus_test_definitions/server/procedures/S-OPT-04.yaml +32 -0
  115. cactus_test_definitions/server/procedures/test-procedures.yaml +14 -0
  116. cactus_test_definitions/server/test_procedures.py +183 -0
  117. cactus_test_definitions/variable_expressions.py +419 -0
  118. cactus_test_definitions-1.0.0.dist-info/METADATA +288 -0
  119. cactus_test_definitions-1.0.0.dist-info/RECORD +135 -0
  120. cactus_test_definitions-1.0.0.dist-info/WHEEL +5 -0
  121. cactus_test_definitions-1.0.0.dist-info/licenses/LICENSE.txt +22 -0
  122. cactus_test_definitions-1.0.0.dist-info/top_level.txt +2 -0
  123. tests/__init__.py +0 -0
  124. tests/unit/__init__.py +0 -0
  125. tests/unit/client/__init__.py +0 -0
  126. tests/unit/client/test_actions.py +72 -0
  127. tests/unit/client/test_checks.py +47 -0
  128. tests/unit/client/test_config.py +61 -0
  129. tests/unit/client/test_events.py +36 -0
  130. tests/unit/client/test_test_procedures.py +150 -0
  131. tests/unit/server/__init__.py +0 -0
  132. tests/unit/server/test_test_procedures.py +86 -0
  133. tests/unit/test_csipaus.py +49 -0
  134. tests/unit/test_parameters.py +197 -0
  135. tests/unit/test_variable_expressions.py +402 -0
@@ -0,0 +1,288 @@
1
+ Metadata-Version: 2.4
2
+ Name: cactus-test-definitions
3
+ Version: 1.0.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
+ Provides-Extra: docs
39
+ Requires-Dist: sphinx; extra == "docs"
40
+ Dynamic: license-file
41
+
42
+ # Cactus Test Definitions
43
+
44
+ This repository contains YAML test procedure definitions for use with the CSIP-AUS Client/Server Test Harnesses.
45
+
46
+ 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.
47
+
48
+ **Client Test Procedures** can be found in the [cactus_test_definitions/client/procedures/](cactus_test_definitions/client/procedures/) directory
49
+
50
+ **Server Test Procedures** can be found in the [cactus_test_definitions/server/procedures/](cactus_test_definitions/server/procedures/) directory
51
+
52
+
53
+ ## Development / Testing
54
+
55
+ This repository also contains a small number of tests that verify that test definitions can be sucessfully converted to their equivalent python dataclasses.
56
+
57
+ First install the development and testing dependencies with,
58
+
59
+ ```sh
60
+ python -m pip install --editable .[dev,test]
61
+ ```
62
+
63
+ Once installed, run the tests with,
64
+
65
+ ```sh
66
+ pytest
67
+ ```
68
+
69
+ ## Server Test Procedure Schema
70
+
71
+ See [cactus_test_definitions/server/README.md](README)
72
+
73
+ ## Client Test Procedure Schema
74
+
75
+ 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.
76
+
77
+ Here is a minimalist definition of a test case
78
+
79
+ ```
80
+ Description: Minimal Test Case Definition
81
+ Category: Explaining Schemas
82
+ Classes:
83
+ - Descriptive Test Tag 1
84
+ - Descriptive Test Tag 2
85
+ Preconditions:
86
+ # See definitions below for more info
87
+ actions:
88
+ checks:
89
+ Criteria:
90
+ # See definitions below for more info
91
+ checks:
92
+ Steps:
93
+ # See definitions below for more info
94
+ STEP_NAME:
95
+ ```
96
+
97
+ 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.
98
+
99
+ ## Steps/Events Schema
100
+
101
+ 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.
102
+
103
+ When a `TestProcedure` first starts, normally only a single `Step` will be active but more can be enabled/disabled in response to client behaviour.
104
+
105
+ Step Schema:
106
+ ```
107
+ Steps:
108
+ DESCRIPTIVE_TITLE_OF_STEP: # This is used to reference this step in other parts of this test procedure
109
+ event: #
110
+ type: # string identifier of the event type - see table below
111
+ parameters: # Any parameters to modify the default behaviour of the event - see table below
112
+ checks: # A list of Check definitions that will need to be true for this event to trigger - see section on Checks below
113
+ actions:
114
+ # See action schema in the Action section below
115
+ ```
116
+
117
+ These are the currently defined `Event` types that a `Step` can define
118
+ | **name** | **params** | **description** |
119
+ | -------- | ---------- | --------------- |
120
+ | `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) |
121
+ | `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) |
122
+ | `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) |
123
+ | `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) |
124
+ | `wait` | `duration_seconds: str` | Triggers `duration_seconds` after being initially activated |
125
+
126
+ **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).
127
+
128
+ eg:
129
+
130
+ * `/edev/*/derp/456/derc` will match `/edev/123/derp/456/derc`
131
+ * `/edev/*` will NOT match `/edev/123/derp/456/derc` (the `*` will only match the `123` portion - not EVERYTHING)
132
+
133
+
134
+ ### Actions
135
+
136
+ 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.
137
+
138
+ `Action`'s are defined with the following schema, always as a list under an element called `actions`
139
+ ```
140
+ actions:
141
+ - type: # string identifier of the action type - see table below
142
+ parameters: # Any parameters to supply to the executed Action - see table below
143
+ ```
144
+
145
+ This is an example of two `Action` elements that will enable a different Step and create a DERControl:
146
+
147
+ ```
148
+ actions:
149
+ - type: enable-steps
150
+ parameters:
151
+ steps: NAME_OF_STEP_TO_ENABLE
152
+ - type: create-der-control
153
+ parameters:
154
+ start: $now
155
+ duration_seconds: 300
156
+ opModExpLimW: 2000
157
+ ```
158
+
159
+
160
+ | **name** | **params** | **description** |
161
+ | -------- | ---------- | --------------- |
162
+ | `enable-steps` | `steps: list[str]` | The names of `Step`'s that will be activated |
163
+ | `remove-steps` | `steps: list[str]` | The names of `Step`'s that will be deactivated (if active) |
164
+ | `finish-test` | None | When activated, the current test will be finished (shutdown) and all `Criteria` evaluated as if the client had requested finalization. |
165
+ | `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 |
166
+ | `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 |
167
+ | `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. |
168
+ | `cancel-active-der-controls` | None | Cancels all active DERControls |
169
+ | `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. |
170
+ | `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 |
171
+ | `edev-registration-links` | `enabled: bool` | If `enabled: false` `EndDevice` entities will NOT encode `RegistrationLink` elements. Defaults to `enabled: true` at test start |
172
+ | `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. |
173
+
174
+
175
+ ### Checks
176
+
177
+ 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`.
178
+
179
+ `Check`'s are defined with the following schema, always as a list under an element called `checks`
180
+ ```
181
+ checks:
182
+ - type: # string identifier of the check type - see table below
183
+ parameters: # Any parameters to supply to the executed Check - see table below
184
+ ```
185
+
186
+
187
+ 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:
188
+
189
+ ```
190
+ checks:
191
+ - type: all-steps-complete
192
+ parameters: {}
193
+ - type: der-status-contents
194
+ parameters:
195
+ genConnectStatus: 1
196
+ ```
197
+
198
+ | **name** | **params** | **description** |
199
+ | -------- | ---------- | --------------- |
200
+ | `all-steps-complete` | `ignored_steps: list[str]/None` | True if every `Step` in a `TestProcedure` has been deactivated (excepting any ignored steps) |
201
+ | `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 |
202
+ | `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. |
203
+ | `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) |
204
+ | `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) |
205
+ | `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) |
206
+ | `readings-site-active-power` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide active power with `minimum_count` entries |
207
+ | `readings-site-reactive-power` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide reactive power with `minimum_count` entries |
208
+ | `readings-voltage` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for site wide voltage OR DER voltage with `minimum_count` entries (at least one is required) |
209
+ | `readings-der-active-power` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for DER active power with `minimum_count` entries |
210
+ | `readings-der-reactive-power` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for DER reactive power with `minimum_count` entries |
211
+ | `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` |
212
+ | `subscription-contents` | `subscribed_resource: str` | True if a subscription to `subscribed_resource` has been created |
213
+
214
+ The following are csipaus.org/ns/v1.3-beta/storage extension specific checks implemented
215
+
216
+ | **name** | **params** | **description** |
217
+ | -------- | ---------- | --------------- |
218
+ | `readings-der-stored-energy` | `minimum_count: int` | True if any MirrorUsagePoint has a MirrorMeterReading for DER stored energy with `minimum_count` entries |
219
+ <br>
220
+
221
+ #### Hexbinary Parameters for Bitwise Operations
222
+ `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
223
+ 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
224
+
225
+ If a common bit is set between a `_set` and `_unset` corresponding pair of parameters, the check will always fail.
226
+
227
+ ### Parameter Variable Resolution
228
+
229
+ Any `parameter` element expects a series of name/value pairs to pass to the "parent" `Action`, `Check` or `Event`. For example:
230
+
231
+ ```
232
+ parameters:
233
+ number_param: 123
234
+ text_param: Text Content
235
+ date_param: 2020-01-02 03:04:05Z
236
+
237
+ ```
238
+
239
+ 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.
240
+
241
+ ```
242
+ parameters:
243
+ number_param: $setMaxW
244
+ text_param: Text Content
245
+ date_param: $now
246
+
247
+ ```
248
+
249
+ The following are all the `NamedVariable` types currently implemented
250
+
251
+ | **name** | **description** |
252
+ | -------- | --------------- |
253
+ | `$now` | Resolves to the current moment in time (timezone aware). Returns a datetime |
254
+ | `$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`
255
+ | `$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) |
256
+ | `$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) |
257
+ | `$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) |
258
+ | `$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) |
259
+ | `$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) |
260
+ | `$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) |
261
+ | `$rtgMaxVA` | Resolves to last supplied `DERCapability.rtgMaxVA` as a number. Raises exceptions if value hasn't been set, causing test to fail.
262
+ | `$rtgMaxVar` | Resolves to last supplied `DERCapability.rtgMaxVar` as a number. Raises exceptions if value hasn't been set, causing test to fail.
263
+ | `$rtgMaxW` | Resolves to last supplied `DERCapability.rtgMaxW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
264
+ | `$rtgMaxChargeRateW` | Resolves to last supplied `DERCapability.rtgMaxChargeRateW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
265
+ | `$rtgMaxDischargeRateW` | Resolves to last supplied `DERCapability.rtgMaxDischargeRateW` as a number. Raises exceptions if value hasn't been set, causing test to fail.
266
+ | `$rtgMaxWh` | Resolves to last supplied `DERCapability.rtgMaxWh` as a number. Raises exceptions if value hasn't been set, causing test to fail.
267
+
268
+ The following are csipaus.org/ns/v1.3-beta/storage extension specific `NamedVariable` types implemented
269
+
270
+ | **name** | **description** |
271
+ | -------- | --------------- |
272
+ | `$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)
273
+
274
+
275
+ Placeholder variables can also be used in some rudimentary expressions to make variations on the returned value. For example:
276
+
277
+ ```
278
+ parameters:
279
+ number_param: $(setMaxW / 2)
280
+ text_param: Text Content
281
+ date_param: $(now - '5 mins')
282
+ setMaxW: $(this < rtgMaxW)
283
+ setMaxVA: $(this >= rtgMaxWh)
284
+ ```
285
+
286
+ 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.
287
+ `setMaxW` param will return boolean result `DERSettings.setMaxW` is less than `DERCapability.rtgMaxW`.
288
+ `setMaxVA` param will return boolean result `DERSettings.setMaxVA` is greather than or equal to `DERCapability.rtgMaxWh`.
@@ -0,0 +1,135 @@
1
+ cactus_test_definitions/__init__.py,sha256=8922l9SE1TJPThuMUKvAhBOda6WYkIHv2lMdC2JoNQ8,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=y2pCrE6MADXA53ZVZeNWj0_yWHcKOZ2imzjh_pZDorQ,6509
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=dYoKIFULPBc34v8ujGwkvVRE48LafqbMBXB5Qb18gIU,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=1nEnSTaibqQkMhR21qfreudmWnCT8EI-s1Eu-LiXEl4,7336
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=M5rZLtoAKOgtzgC51KlB_iVhS3mo1ujMjJg5cnD4Z3w,692
21
+ cactus_test_definitions/client/actions.py,sha256=tJNNVmK_itcXPgHxewBZvUsw3u0WK67S5zliULGForI,4924
22
+ cactus_test_definitions/client/checks.py,sha256=8MEfG5YDVPFXrIySf_e2ePnLUHqdd3Odq7LmIIFGeDI,7415
23
+ cactus_test_definitions/client/events.py,sha256=Skt7rovadrpVqY7nUpxP0MGG_-1wWlD28JPKhZX-z8E,3098
24
+ cactus_test_definitions/client/test_procedures.py,sha256=7ZUlBXf6r6DHVakJpLseYaG_mpbjyqFFE0SwYOcU0UU,11059
25
+ cactus_test_definitions/client/__pycache__/__init__.cpython-312.pyc,sha256=nk72E-Cj_QWolW48s8S_mHerqAhMnb4f8CT0_QSvUqA,785
26
+ cactus_test_definitions/client/__pycache__/actions.cpython-312.pyc,sha256=nmXKfZ2vRrsjmPjEjLN_eII4a-QxLhCh-A4K8yzHrEA,5476
27
+ cactus_test_definitions/client/__pycache__/checks.cpython-312.pyc,sha256=0mJ5tPanLA-6Tcmqw3Mlz3GU83HquLGMX6sYLocisJU,7441
28
+ cactus_test_definitions/client/__pycache__/events.cpython-312.pyc,sha256=foHaDQq7KpzAZ-j9nSQKdCcYy0IZx0g5ZSCkFYFTEFg,3650
29
+ cactus_test_definitions/client/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc,sha256=dhs4Rti_k3tjssN-3vglLoQ2qM2NHuZ0go2bWdlgoSo,13208
30
+ cactus_test_definitions/client/procedures/ALL-01.yaml,sha256=2RdNwqHMo-otjMEOoIwWgjOaTfj7_dRWfV2HGKMGQ-s,2246
31
+ cactus_test_definitions/client/procedures/ALL-02.yaml,sha256=a7ykQVfu3Wazy1LBMOCZVYZkyAitpDt4MBgUq4ocRgE,2346
32
+ cactus_test_definitions/client/procedures/ALL-03-REJ.yaml,sha256=TZcKMZqJmRwnsrBA9mhcngmVVJ9PCSVfmbAF4_2EOxQ,1924
33
+ cactus_test_definitions/client/procedures/ALL-03.yaml,sha256=Qer-pPxkhbtTnlpbcgyBC59RB9IR_lHQ2U7idbWtFL8,2215
34
+ cactus_test_definitions/client/procedures/ALL-04.yaml,sha256=pnfXRcu2H1q4xXZymXQFGf9qf4Q1ZMpoj2K6hP2U45c,1852
35
+ cactus_test_definitions/client/procedures/ALL-05.yaml,sha256=pSAMbxax1UmAw3lG9jSSL0T-X79XhVdjoEE7hQ4R7Rg,2584
36
+ cactus_test_definitions/client/procedures/ALL-06.yaml,sha256=-RAihWv3V1lRAl6f9ugVGgLfef5mR3kQNpxuzXjK-CI,3251
37
+ cactus_test_definitions/client/procedures/ALL-07.yaml,sha256=vXxOevhlvhcStPIbYpXf28WEYOkWhHfkNPWbXHK2MZw,1860
38
+ cactus_test_definitions/client/procedures/ALL-08.yaml,sha256=Zv-XzXo0i6neHQemDUBLJY0ullYjID7Oa-oJOQd1Y4A,2059
39
+ cactus_test_definitions/client/procedures/ALL-09.yaml,sha256=dDhwz2tXd6NtIo6qitWW-zped0KEislvzxhDlLEvjAI,3052
40
+ cactus_test_definitions/client/procedures/ALL-10.yaml,sha256=slSJz4w7lBDSjPk1ke0Q_Cxmj3rj19SzdOdF1AKat6M,2955
41
+ cactus_test_definitions/client/procedures/ALL-11.yaml,sha256=sXmP3CTHuIFFpuRDVPMgZBM39u4s9n4A37ZA1QeGumA,2687
42
+ cactus_test_definitions/client/procedures/ALL-12.yaml,sha256=MGNYtGFVyeXOGDm9sz-sIYWw1ydH6ocV2x3rh3znNpU,2608
43
+ cactus_test_definitions/client/procedures/ALL-13.yaml,sha256=5B6B-ha0KmNRB-YCBSbS9x08rmWgsozCJYkAcWN3zh8,2747
44
+ cactus_test_definitions/client/procedures/ALL-14.yaml,sha256=4JMnmleJ77dtIdhNUeHjihaq6UUMsk4o42lcv8xe3Us,4948
45
+ cactus_test_definitions/client/procedures/ALL-15.yaml,sha256=UNzUmjvQO2tqjF2fGoiij1DRMqwaxHfxDYklctKFuZc,2889
46
+ cactus_test_definitions/client/procedures/ALL-16.yaml,sha256=pKv7llpcFp5zInkULOXndaC2SRAHW20r6T61Xnin5VY,2716
47
+ cactus_test_definitions/client/procedures/ALL-17.yaml,sha256=hmDKdRxSemFgMHUwpN_B1V9Z6rWE4hrzmUo_6cmfUBw,1600
48
+ cactus_test_definitions/client/procedures/ALL-18.yaml,sha256=6ChaL1VcK0ET8NwC02vkNRtjLHvj__NvpRknsBtgVlg,6855
49
+ cactus_test_definitions/client/procedures/ALL-19.yaml,sha256=V9bFWAfkWKdqLpCSnapWTuEvLWAGK2gEOpjVKFpOBZg,1493
50
+ cactus_test_definitions/client/procedures/ALL-20.yaml,sha256=SHJyX6_HvplWhQKgwKMvNFFH8Ox53JEiupWWkLkhOVM,2873
51
+ cactus_test_definitions/client/procedures/ALL-21.yaml,sha256=sYCsjrGlFVnAXxyAmMBWmX9P_VnoFfj7o8scyB_oKwc,5929
52
+ cactus_test_definitions/client/procedures/ALL-22.yaml,sha256=X18P3DUlfv2w60iz1PmsOUXBMuvUUI7cPBLy-hC1-GU,2128
53
+ cactus_test_definitions/client/procedures/ALL-23.yaml,sha256=hIiufcCmhCdGBOqH3eKZlMeFIUziIZYpKC0x6thuQjA,3838
54
+ cactus_test_definitions/client/procedures/ALL-24.yaml,sha256=b_oyCXia0twYwj6NxXvevBB5JJRUADgL40EdikRRgR4,3189
55
+ cactus_test_definitions/client/procedures/ALL-25.yaml,sha256=ojLqgzDGxF9-TnXUiZHC1PKaVw5Jj-RNBx0BDWjzpOc,3213
56
+ cactus_test_definitions/client/procedures/ALL-26.yaml,sha256=KKuWDpsEGdUM7F4aJ_QRwvug11nrKqRCPyvxeAaQNWE,3654
57
+ cactus_test_definitions/client/procedures/ALL-27.yaml,sha256=HIzw1VjCDrgdeLGUPpbZ8Xx0H12wyA00O4I42BYGOuI,3524
58
+ cactus_test_definitions/client/procedures/ALL-28.yaml,sha256=i1yHOn27FChrrktVzNDZzPfNL9kDN31n-fDAQv_gnLU,6644
59
+ cactus_test_definitions/client/procedures/ALL-29.yaml,sha256=bHOKU-rhwgqYsFZs2SOlj8iArbv0-OV_M691KTSCE_A,2373
60
+ cactus_test_definitions/client/procedures/ALL-30.yaml,sha256=E0y-QMnro2A0cLEZQP3_zrgMSWgrEz4-EHxB_fxS72k,4704
61
+ cactus_test_definitions/client/procedures/BES-01.yaml,sha256=HOYIEqaa_q9VSsiGv5cISJrQDoPj0Ry6qd5eVTfkDwE,3219
62
+ cactus_test_definitions/client/procedures/BES-02.yaml,sha256=a1VQ1e4r4fO6LqlV6-ivIdg0S_0vgSTcSs8lB3RRZkk,3154
63
+ cactus_test_definitions/client/procedures/BES-03.yaml,sha256=Sem23i5kkegx7UFAd8Qy4p6qXcLTQdiVRGhbMkWEtIc,3315
64
+ cactus_test_definitions/client/procedures/BES-04.yaml,sha256=Xp9tCaXvskhtIuUvsuBZoGoCWHTrCEC6McqCEbqQoMo,5854
65
+ cactus_test_definitions/client/procedures/DRA-01.yaml,sha256=jVR0y58T7rqh363pN1HBrLtp84J58WiEep8E3aY3UoY,1246
66
+ cactus_test_definitions/client/procedures/DRA-02.yaml,sha256=GeWpMGsgsbPf4NDSJjfcT_VgfRVEjSqrOxNpvtT2mf0,1378
67
+ cactus_test_definitions/client/procedures/DRD-01.yaml,sha256=DNGMQ4rDU77ZP8URKmE6my7wW-ccyzQ4dPqMWXvrC6s,15935
68
+ cactus_test_definitions/client/procedures/DRL-01.yaml,sha256=KByMyyzarsXpRjvDTVTNC5941Dh7agDnAo3SYj7w9zw,7666
69
+ cactus_test_definitions/client/procedures/GEN-01.yaml,sha256=z0NHCjyO5sZZl3C8f5pEe0zgZdaP0RfBQSgaaKAaYm4,1588
70
+ cactus_test_definitions/client/procedures/GEN-02.yaml,sha256=0v2S1120FrR2LuI3shZO3sHCKxI_iK13JOWawFlzqsQ,1579
71
+ cactus_test_definitions/client/procedures/GEN-03.yaml,sha256=sg_OSAiOsHx3v6GaWpQ0vsUd-wqu5O_76lJdQeZWdtE,4264
72
+ cactus_test_definitions/client/procedures/GEN-04.yaml,sha256=84GpwRnInstPytQ--oPwxF2o68-1n4mcHE7p7ilf7rI,4254
73
+ cactus_test_definitions/client/procedures/GEN-05.yaml,sha256=l0X9cpynooHXFs7L2LEb3jRd3jdI8fG0pt1Ldb3cMik,2338
74
+ cactus_test_definitions/client/procedures/GEN-06.yaml,sha256=lI0rdSpoMxEUTpBgur6mWj4lYODdBrSC67fl1-gWfwY,2320
75
+ cactus_test_definitions/client/procedures/GEN-07.yaml,sha256=ij4yLjZlWys7kkfgaEiA907db0gPjODpeGBf8u_FGjE,3834
76
+ cactus_test_definitions/client/procedures/GEN-08.yaml,sha256=IxOtwAJMuvGwLDaFa-h2mR_jeeUo6tzmPi13ToOsxnY,3810
77
+ cactus_test_definitions/client/procedures/GEN-09.yaml,sha256=_UCMImEyS4j64g17uv1Zo1a6XXQvyAQfaABApEOFVSc,2738
78
+ cactus_test_definitions/client/procedures/GEN-10.yaml,sha256=xgIP-0iQgleNjpgCfcxLpuHffNxQVbr8SPW0l1pfDOo,18163
79
+ cactus_test_definitions/client/procedures/GEN-11.yaml,sha256=T4SpFWIqphNfrvvIanIhM8G7DvfycN-2KlyDeQAtVXQ,9396
80
+ cactus_test_definitions/client/procedures/GEN-12.yaml,sha256=l1B0d4A3AqVxSkJRatFKBpe9dZVh2cbromWR4zJd0fA,9400
81
+ cactus_test_definitions/client/procedures/GEN-13.yaml,sha256=W_l7RRgyUjA86iU3ZEY5R8kcmRpGYjdh-QXlnS4vLNg,1944
82
+ cactus_test_definitions/client/procedures/LOA-01.yaml,sha256=VYEHZjCBXuwYqwZT7RnJrMn8cZdAZJ8cOe8hRrx_Q_c,1592
83
+ cactus_test_definitions/client/procedures/LOA-02.yaml,sha256=27YRxcD1_TN8rAbKEh86_aIYM6856SKSBQYRVLPdetI,1591
84
+ cactus_test_definitions/client/procedures/LOA-03.yaml,sha256=seYSqDjEck3oquzacZbgZQRMq6_mhA1TrrrHSlZHMqc,4264
85
+ cactus_test_definitions/client/procedures/LOA-04.yaml,sha256=mSEBWuPPNHIc3EuS8h1Z3D1lcwwA00d6RP6XhfxzeBk,4243
86
+ cactus_test_definitions/client/procedures/LOA-05.yaml,sha256=E6VJaKiA6FWgBAXabCDtqbJ3SOIDjpYuBb2tamdnjzo,2272
87
+ cactus_test_definitions/client/procedures/LOA-06.yaml,sha256=RcMTHVFLLkJZ6T1Ld-SuKkPNGj5x4q7HIhEdEAjum30,2238
88
+ cactus_test_definitions/client/procedures/LOA-07.yaml,sha256=oMGudpytVstjt7px6ELF5o1mYZGWpImz7XpgLeansq8,3836
89
+ cactus_test_definitions/client/procedures/LOA-08.yaml,sha256=gOpizgOqDHDq6naatEZyqXCpSI7ZZXljvdA6v6sxHbY,3809
90
+ cactus_test_definitions/client/procedures/LOA-09.yaml,sha256=Iiwr4RSho8v9ScoNa4gwasGRrqUGv--TbCXuKieTsvo,2738
91
+ cactus_test_definitions/client/procedures/LOA-10.yaml,sha256=l6v2yka06gGZwoPvRzCsq30J4_NcEDc4_NV02ta8m58,18173
92
+ cactus_test_definitions/client/procedures/LOA-11.yaml,sha256=-kMt69Z6Jhv9z7Wtk1Gq41YIOcYEDUdqOkJnHC1bTlM,9396
93
+ cactus_test_definitions/client/procedures/LOA-12.yaml,sha256=g6rI-WOxxFi1eDUCE2aVsBnmDXqil1bh2sR5dBoncHA,9399
94
+ cactus_test_definitions/client/procedures/LOA-13.yaml,sha256=l7iSWNKy-Lkii7GEfdD2qP7KjXa2IX5TI7cGArMzB6o,1945
95
+ cactus_test_definitions/client/procedures/MUL-01.yaml,sha256=Gr2HhsfbWqZSlCBproJiNaa3sltynIwbC5UbmVTTjLw,2575
96
+ cactus_test_definitions/client/procedures/MUL-02.yaml,sha256=WENhaE0PFb6cifMi3cWyF2YDM0ZnGD2VT9nVgYzqvd8,2239
97
+ cactus_test_definitions/client/procedures/MUL-03.yaml,sha256=vUTmUMywGGNwuK7w7i47NuDHP5lDmDJG-v_T76nz1tA,1864
98
+ cactus_test_definitions/client/procedures/OPT-1-IN-BAND.yaml,sha256=x0Bqs6oJYH-05vp6aAcQSTf4Ao1pCJ4AMUsvP5a-uGY,2293
99
+ cactus_test_definitions/client/procedures/OPT-1-OUT-OF-BAND.yaml,sha256=YbyxKM_wtRKaAzRpD1slLhZqsvOUTDuUQvcQzytpBec,2328
100
+ cactus_test_definitions/client/procedures/test-procedures.yaml,sha256=ZUCmqDvBruGRhIHPJmWWRLFWmhqhiWh-dx_q07rLsg8,2293
101
+ cactus_test_definitions/server/README.md,sha256=RyaqgDP7a_zv0KGRuxDeufk9t-I5SKv5VFpzMytrXAI,10730
102
+ cactus_test_definitions/server/actions.py,sha256=lIJUHsnYVQ8ETN9o6G_bBvPT3X8QqZNZ-VB_vGslvy0,8196
103
+ cactus_test_definitions/server/checks.py,sha256=JTNkeekv6J-haSsbLYXjtFRrCkivQceK8zFVoADJdbY,6980
104
+ cactus_test_definitions/server/test_procedures.py,sha256=AaQV49ENqLyzSmwSTfubVPVzu6KX0gA1bW3SDAq1ENg,7334
105
+ cactus_test_definitions/server/__pycache__/actions.cpython-312.pyc,sha256=fJDI3PeLy1ygGieavKH4IEBjBhEDD7Y9hsAEvxWq7nw,6315
106
+ cactus_test_definitions/server/__pycache__/checks.cpython-312.pyc,sha256=e88BjRuT0urt_W6VKhSky5s0oJa7rC6yWVvK99elwEY,5542
107
+ cactus_test_definitions/server/__pycache__/test_procedures.cpython-312-pytest-8.3.5.pyc,sha256=0gXgC7YBSzVxbTMyr1BGm-9hRupsV3FV9uwBMpma3xw,8790
108
+ cactus_test_definitions/server/procedures/S-ALL-01.yaml,sha256=p5TTsxdk__zsGmki0bggxFa2utqjgelv-5oakUxRIZw,844
109
+ cactus_test_definitions/server/procedures/S-ALL-02.yaml,sha256=dAId6vNhHCHF1jdCGcO5xxs5d5RenAXaH-XrMpNNQ_k,1494
110
+ cactus_test_definitions/server/procedures/S-ALL-03.yaml,sha256=gzNHYyUa0C3iYdQAL-4xRgbejd-7xIYgekWuyPBUJ-U,1502
111
+ cactus_test_definitions/server/procedures/S-ALL-04.yaml,sha256=lNB9yFRcV1jtbnvXU-MZhY68YVitTV1hKlvImNyDpuU,3247
112
+ cactus_test_definitions/server/procedures/S-ALL-05.yaml,sha256=-p_9-yl--RG2HQAh02xYhP1k78XQ1z45Pc_hkbD-35c,2509
113
+ cactus_test_definitions/server/procedures/S-OPT-01.yaml,sha256=p1XYhKBFoUa1VrJyxhnd4Bm762tkjkpvvyd8oApo14I,909
114
+ cactus_test_definitions/server/procedures/S-OPT-02.yaml,sha256=jMoMRo_vgfaB9yoY9LHI8jTtGrfqttGHqRTV2lihAcc,883
115
+ cactus_test_definitions/server/procedures/S-OPT-03.yaml,sha256=tOzDTOE9D-CWT61RuWRTDGcpt7W57NcH9_eZvQyLhFs,980
116
+ cactus_test_definitions/server/procedures/S-OPT-04.yaml,sha256=o33HNLTzxQm__KbFW1x2ce04uW-xx6Li0aijJI_XbYQ,667
117
+ cactus_test_definitions/server/procedures/test-procedures.yaml,sha256=3GqHgROh3YvenXB3RH9lg05809IqAtp_uohT_hUdyIE,395
118
+ cactus_test_definitions-1.0.0.dist-info/licenses/LICENSE.txt,sha256=xCq-ofiZHRqQJHkhY1M-eXahPozfXmo9qvez6BiCOdk,1074
119
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
+ tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
+ tests/unit/test_csipaus.py,sha256=edFnWDlHgMuW7CK9l8z-FHA1GcIACVJ1RPERiFuWfcY,1959
122
+ tests/unit/test_parameters.py,sha256=FqkJtC2Tct9hbuznzzsNyomvmZ24Q3RS2B_tfK0-T5M,8484
123
+ tests/unit/test_variable_expressions.py,sha256=HTeEcLiJPmMREJs4mOfR0Q48l8E-XYyQgISn5XLW2BU,15969
124
+ tests/unit/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
+ tests/unit/client/test_actions.py,sha256=pIVprTLPpD4mGkmORArIEKuoFShzWleakqEZHDGV4rQ,3172
126
+ tests/unit/client/test_checks.py,sha256=PPQDnoZU02-nXcWaXBfm09hG9DUx7O6ZCPVbshazy78,2419
127
+ tests/unit/client/test_config.py,sha256=0Jdgd6DsZuq35OQDUP-l9H9QlQuNaaqDXWV_r7ssLto,2454
128
+ tests/unit/client/test_events.py,sha256=bXDW0Ykx9hqh8MLv1b_9a942LahlhE3L2pu7NyGsdRo,1550
129
+ tests/unit/client/test_test_procedures.py,sha256=GKOQo007C4o4DbsCL4aJfpPqz108ueQ-zJUpwHu56Uw,6950
130
+ tests/unit/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
+ tests/unit/server/test_test_procedures.py,sha256=5yC3Npq6PrDqj4A3URcFd5-0cXmLooxWt51OXJ4Kd0U,3976
132
+ cactus_test_definitions-1.0.0.dist-info/METADATA,sha256=Yf6lpPzVnafduRR7IXacoc3kKjUgn7uU6wz7G87coSw,21248
133
+ cactus_test_definitions-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
134
+ cactus_test_definitions-1.0.0.dist-info/top_level.txt,sha256=4tQTXLPjTzH6OYZqOj40IX8XgosTUTUEJTESjtj0KfI,30
135
+ cactus_test_definitions-1.0.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,47 @@
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", {}), False),
12
+ (Check("readings-site-active-power", {"minimum_count": "3"}), False),
13
+ (Check("readings-site-active-power", {"minimum_count": 3}), True),
14
+ (Check("der-settings-contents", {"setGradW": 27}), True),
15
+ (Check("der-settings-contents", {"doeModesEnabled_set": "0f"}), True),
16
+ (Check("der-settings-contents", {"doeModesEnabled_unset": "0f"}), True),
17
+ (Check("der-settings-contents", {"modesEnabled_set": "E"}), True),
18
+ (Check("der-settings-contents", {"modesEnabled_unset": "E"}), True),
19
+ (Check("der-settings-contents", {"doeModesEnabled_set": 12}), False),
20
+ (Check("der-settings-contents", {"doeModesEnabled_unset": 12}), False),
21
+ # Storage extension
22
+ (Check("der-settings-contents", {"vppModesEnabled_set": "1"}), True),
23
+ (Check("der-settings-contents", {"vppModesEnabled_unset": "1"}), True),
24
+ (Check("der-capability-contents", {"vppModesSupported_set": "1"}), True),
25
+ (Check("der-capability-contents", {"vppModesSupported_unset": "1"}), True),
26
+ (Check("readings-der-stored-energy", {"minimum_count": 3}), True),
27
+ ],
28
+ )
29
+ def test_validate_check_parameters(check: Check, is_valid: bool):
30
+ if is_valid:
31
+ validate_check_parameters("foo", check)
32
+ else:
33
+ with pytest.raises(TestProcedureDefinitionError):
34
+ validate_check_parameters("foo", check)
35
+
36
+
37
+ def test_check_expression() -> None:
38
+ """Tests the creation of a Check that has an expression as one of its parameters"""
39
+ type_str = "some_check"
40
+ params = {"setMaxW": "$(this < rtgMaxW)"}
41
+ check = Check(type_str, params)
42
+
43
+ check_set_max_w = check.parameters["setMaxW"]
44
+ assert isinstance(check_set_max_w, varexps.Expression)
45
+ assert check_set_max_w.operation == varexps.OperationType.LT
46
+ assert check_set_max_w.lhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERSETTING_SET_MAX_W)
47
+ assert check_set_max_w.rhs_operand == varexps.NamedVariable(varexps.NamedVariableType.DERCAPABILITY_RTG_MAX_W)