From e6f56cadb8bbf80e2df8984d4125fb81187f4661 Mon Sep 17 00:00:00 2001 From: Deniz Saner Date: Thu, 16 Nov 2023 17:33:34 +0100 Subject: [PATCH] Expose production run uuid (#24) Closes #20 --- src/enlyze/api_clients/production_runs/models.py | 2 ++ src/enlyze/models.py | 3 +++ tests/enlyze/test_client.py | 1 + 3 files changed, 6 insertions(+) diff --git a/src/enlyze/api_clients/production_runs/models.py b/src/enlyze/api_clients/production_runs/models.py index dd18eb0..37bcfb0 100644 --- a/src/enlyze/api_clients/production_runs/models.py +++ b/src/enlyze/api_clients/production_runs/models.py @@ -65,6 +65,7 @@ class Appliance(ApiBaseModel): class ProductionRun(ProductionRunsApiModel): + uuid: UUID appliance: Appliance average_throughput: Optional[float] production_order: str @@ -99,6 +100,7 @@ def to_user_model( productivity = self.productivity.to_user_model() if self.productivity else None return user_models.ProductionRun( + uuid=self.uuid, appliance=appliances_by_uuid[self.appliance.uuid], average_throughput=self.average_throughput, production_order=self.production_order, diff --git a/src/enlyze/models.py b/src/enlyze/models.py index 02e9682..b61ca67 100644 --- a/src/enlyze/models.py +++ b/src/enlyze/models.py @@ -247,6 +247,9 @@ class ProductionRun: """ + #: The UUID of the production run + uuid: UUID + #: The UUID of the appliance the production run was executed on. appliance: Appliance diff --git a/tests/enlyze/test_client.py b/tests/enlyze/test_client.py index d221589..788fded 100644 --- a/tests/enlyze/test_client.py +++ b/tests/enlyze/test_client.py @@ -58,6 +58,7 @@ production_runs_strategy = st.lists( st.builds( production_runs_api_models.ProductionRun, + uuid=st.uuids(), start=datetime_before_today_strategy, end=datetime_today_until_now_strategy, appliance=st.builds(