|
|
| FIXTURES_DIR = os.path.join(os.path.dirname(__file__), "fixtures") |
|
| MINIMAL_ST = os.path.join(FIXTURES_DIR, "minimal.st") |
|
| MINIMAL_MAPPING = os.path.join(FIXTURES_DIR, "minimal_mapping.yaml") |
|
| CONTROL_FLOW_ST = os.path.join(FIXTURES_DIR, "control_flow.st") |
|
| FB_CALLS_ST = os.path.join(FIXTURES_DIR, "fb_calls.st") |
|
| FB_CALLS_MAPPING = os.path.join(FIXTURES_DIR, "fb_calls_mapping.yaml") |
|
| FB_DECLARATION_ST = os.path.join(FIXTURES_DIR, "fb_declaration.st") |
|
| THERMOSTAT_ST = os.path.join(FIXTURES_DIR, "thermostat.st") |
|
| THERMOSTAT_MAPPING = os.path.join(FIXTURES_DIR, "thermostat_mapping.yaml") |
End-to-end tests for the st2js converter.
Tests the full pipeline: ST file + YAML mapping -> JavaScript output.
Verifies that the generated JS matches the expected structure from the
Design Doc FR9 format:
1. load("uniset2-iec61131.js")
2. uniset_inputs array
3. uniset_outputs array
4. Local variable declarations
5. function uniset_on_step() { ... }
Also tests CLI invocation via subprocess and error cases.