From 3611f72be4a576a094874ee553d1a59ec7d7913f Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 28 Mar 2025 11:08:41 +0000 Subject: [PATCH 1/4] save curernt work --- .github/workflows/scis_invoice_calculator.yml | 1 + .github/workflows/sharepoint_validator.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/scis_invoice_calculator.yml b/.github/workflows/scis_invoice_calculator.yml index 140bc2f..6e69f04 100644 --- a/.github/workflows/scis_invoice_calculator.yml +++ b/.github/workflows/scis_invoice_calculator.yml @@ -1,3 +1,4 @@ +name: SCIS Invoice Calculator on: schedule: - cron: '0 9 * * *' diff --git a/.github/workflows/sharepoint_validator.yml b/.github/workflows/sharepoint_validator.yml index 90fe665..a9b4d42 100644 --- a/.github/workflows/sharepoint_validator.yml +++ b/.github/workflows/sharepoint_validator.yml @@ -1,3 +1,4 @@ +name: SharePoint Validator on: schedule: - cron: '0 9 * * *' From a0a3fc67df5f977c1aab4e0f343bfd13ad078c72 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 28 Mar 2025 16:09:03 +0000 Subject: [PATCH 2/4] simple script to run tests --- etl/{load.py => simple_load_example.py} | 0 etl/tests/test_pre_site_note_class.py | 10 +++++++++- run_tests.sh | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) rename etl/{load.py => simple_load_example.py} (100%) create mode 100644 run_tests.sh diff --git a/etl/load.py b/etl/simple_load_example.py similarity index 100% rename from etl/load.py rename to etl/simple_load_example.py diff --git a/etl/tests/test_pre_site_note_class.py b/etl/tests/test_pre_site_note_class.py index a354cfa..143a4f7 100644 --- a/etl/tests/test_pre_site_note_class.py +++ b/etl/tests/test_pre_site_note_class.py @@ -18,4 +18,12 @@ def local_survey(pre_site_note_path): def test_assessor_accreditation(local_survey): """Test that the assessor accreditation number is correct.""" - assert local_survey.pre_site_note.assessor_information.accreditation_number == "QUID211435" \ No newline at end of file + assert local_survey.pre_site_note.assessor_information.accreditation_number == "QUID211435" + + +def test_floor_area_calculator(local_survey): + # Floor area is important to work out invoice, make a test to work out invoice correctly + print(local_survey) + raise NotImplementedError("Yo - junte do some work here") + + diff --git a/run_tests.sh b/run_tests.sh new file mode 100644 index 0000000..c7c20e0 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1 @@ +poetry run pytest From 72bb09eb4144797e41fc91c5d22e3fc2b58c73fa Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Fri, 28 Mar 2025 16:15:39 +0000 Subject: [PATCH 3/4] force a breakage in test so I do it --- etl/tests/test_pre_site_note_class.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etl/tests/test_pre_site_note_class.py b/etl/tests/test_pre_site_note_class.py index 143a4f7..2fddd52 100644 --- a/etl/tests/test_pre_site_note_class.py +++ b/etl/tests/test_pre_site_note_class.py @@ -23,7 +23,7 @@ def test_assessor_accreditation(local_survey): def test_floor_area_calculator(local_survey): # Floor area is important to work out invoice, make a test to work out invoice correctly - print(local_survey) raise NotImplementedError("Yo - junte do some work here") + From 8ee0a236f909ae94a47edc894b9ff80eec07b4b6 Mon Sep 17 00:00:00 2001 From: Jun-te Kim Date: Mon, 31 Mar 2025 10:37:14 +0000 Subject: [PATCH 4/4] finsihed writing floor area, add more test as I need them@ --- .github/workflows/scis_invoice_calculator.yml | 2 +- .github/workflows/sharepoint_validator.yml | 2 +- etl/tests/test_pre_site_note_class.py | 9 ++++----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/scis_invoice_calculator.yml b/.github/workflows/scis_invoice_calculator.yml index 6e69f04..66a5461 100644 --- a/.github/workflows/scis_invoice_calculator.yml +++ b/.github/workflows/scis_invoice_calculator.yml @@ -1,7 +1,7 @@ name: SCIS Invoice Calculator on: schedule: - - cron: '0 9 * * *' + - cron: '0 6 * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/sharepoint_validator.yml b/.github/workflows/sharepoint_validator.yml index a9b4d42..bc22bee 100644 --- a/.github/workflows/sharepoint_validator.yml +++ b/.github/workflows/sharepoint_validator.yml @@ -1,7 +1,7 @@ name: SharePoint Validator on: schedule: - - cron: '0 9 * * *' + - cron: '0 6 * * *' workflow_dispatch: jobs: diff --git a/etl/tests/test_pre_site_note_class.py b/etl/tests/test_pre_site_note_class.py index 2fddd52..58cf3e7 100644 --- a/etl/tests/test_pre_site_note_class.py +++ b/etl/tests/test_pre_site_note_class.py @@ -4,7 +4,7 @@ from etl.surveyedData.surveryedData import surveyedDataProcessor from etl.db.db import get_db_session, init_db from etl.transform.types import AssessorInfo import pytest - +from etl.jjc_invoice import work_out_total_floor_area @pytest.fixture(scope="module") def pre_site_note_path(): @@ -23,7 +23,6 @@ def test_assessor_accreditation(local_survey): def test_floor_area_calculator(local_survey): # Floor area is important to work out invoice, make a test to work out invoice correctly - raise NotImplementedError("Yo - junte do some work here") - - - + area = work_out_total_floor_area(local_survey.pre_site_note) + assert area == ('73-97m', 91) + \ No newline at end of file