From ae366a84a22f8f047803ee8843305b844716984b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Fri, 20 Sep 2024 22:37:02 +0200 Subject: [PATCH] Add new test scenarios --- .../engine_test/test_missing_dependency.yaml | 44 +++++++++++++++++++ .../test_stay_off_min_downtime.yaml | 30 +++++++++++++ .../engine_test/test_stay_on_min_uptime.yaml | 30 +++++++++++++ ...onf.yaml => test_turn_on_consumption.yaml} | 0 .../engine_test/test_turn_on_priority.yaml | 44 +++++++++++++++++++ 5 files changed, 148 insertions(+) create mode 100644 central_backend/engine_test/test_missing_dependency.yaml create mode 100644 central_backend/engine_test/test_stay_off_min_downtime.yaml create mode 100644 central_backend/engine_test/test_stay_on_min_uptime.yaml rename central_backend/engine_test/{test_basic_conf.yaml => test_turn_on_consumption.yaml} (100%) create mode 100644 central_backend/engine_test/test_turn_on_priority.yaml diff --git a/central_backend/engine_test/test_missing_dependency.yaml b/central_backend/engine_test/test_missing_dependency.yaml new file mode 100644 index 0000000..3c1838a --- /dev/null +++ b/central_backend/engine_test/test_missing_dependency.yaml @@ -0,0 +1,44 @@ +devices: + - id: dev1 + info: + reference: A + version: 0.0.1 + max_relays: 1 + time_create: 1 + time_update: 1 + name: Dev1 + description: Day1 + validated: true + enabled: true + relays: + - id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9 + name: R1 + enabled: true + priority: 1 + consumption: 100 + minimal_uptime: 10 + minimal_downtime: 1000 + depends_on: [] + conflicts_with: [] + + on: false + for: 5 + should_be_on: false + + - id: 88888888-bf9b-4de3-99e5-92c1c7dd72e8 + name: R1 + enabled: true + priority: 1 + consumption: 100 + minimal_uptime: 10 + minimal_downtime: 1000 + depends_on: [ dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9 ] + conflicts_with: [ ] + + on: false + for: 5000 + should_be_on: false + + online: true + +curr_consumption: -100000 \ No newline at end of file diff --git a/central_backend/engine_test/test_stay_off_min_downtime.yaml b/central_backend/engine_test/test_stay_off_min_downtime.yaml new file mode 100644 index 0000000..6eb6a6c --- /dev/null +++ b/central_backend/engine_test/test_stay_off_min_downtime.yaml @@ -0,0 +1,30 @@ +devices: + - id: dev1 + info: + reference: A + version: 0.0.1 + max_relays: 1 + time_create: 1 + time_update: 1 + name: Dev1 + description: Day1 + validated: true + enabled: true + relays: + - id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9 + name: R1 + enabled: true + priority: 1 + consumption: 100 + minimal_uptime: 10 + minimal_downtime: 1000 + depends_on: [] + conflicts_with: [] + + on: false + for: 500 + should_be_on: false + + online: true + +curr_consumption: -1000 \ No newline at end of file diff --git a/central_backend/engine_test/test_stay_on_min_uptime.yaml b/central_backend/engine_test/test_stay_on_min_uptime.yaml new file mode 100644 index 0000000..1678e02 --- /dev/null +++ b/central_backend/engine_test/test_stay_on_min_uptime.yaml @@ -0,0 +1,30 @@ +devices: + - id: dev1 + info: + reference: A + version: 0.0.1 + max_relays: 1 + time_create: 1 + time_update: 1 + name: Dev1 + description: Day1 + validated: true + enabled: true + relays: + - id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9 + name: R1 + enabled: true + priority: 1 + consumption: 1000 + minimal_uptime: 10 + minimal_downtime: 1000 + depends_on: [] + conflicts_with: [] + + on: true + for: 5 + should_be_on: true + + online: true + +curr_consumption: 10000 \ No newline at end of file diff --git a/central_backend/engine_test/test_basic_conf.yaml b/central_backend/engine_test/test_turn_on_consumption.yaml similarity index 100% rename from central_backend/engine_test/test_basic_conf.yaml rename to central_backend/engine_test/test_turn_on_consumption.yaml diff --git a/central_backend/engine_test/test_turn_on_priority.yaml b/central_backend/engine_test/test_turn_on_priority.yaml new file mode 100644 index 0000000..8cb8528 --- /dev/null +++ b/central_backend/engine_test/test_turn_on_priority.yaml @@ -0,0 +1,44 @@ +devices: + - id: dev1 + info: + reference: A + version: 0.0.1 + max_relays: 1 + time_create: 1 + time_update: 1 + name: Dev1 + description: Day1 + validated: true + enabled: true + relays: + - id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9 + name: R1 + enabled: true + priority: 1 + consumption: 900 + minimal_uptime: 10 + minimal_downtime: 10 + depends_on: [] + conflicts_with: [] + + on: true + for: 500 + should_be_on: false + + - id: 88888888-bf9b-4de3-99e5-92c1c7dd72e9 + name: R2 + enabled: true + priority: 2 + consumption: 1000 + minimal_uptime: 10 + minimal_downtime: 10 + depends_on: [ ] + conflicts_with: [ ] + + on: false + for: 500 + should_be_on: true + + online: true + +curr_consumption: -900 \ No newline at end of file