From 666afea8c6bf1f8de68798de6a4cf2131401da44 Mon Sep 17 00:00:00 2001 From: abbie-evans <147088150+abbie-evans@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:23:37 +0000 Subject: [PATCH 1/2] Import arrangement Co-authored-by: Kit Gallagher <60467371+KCGallagher@users.noreply.github.com> --- pyEpiabm/pyEpiabm/core/cell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyEpiabm/pyEpiabm/core/cell.py b/pyEpiabm/pyEpiabm/core/cell.py index aa20a4fde..c1ea21bca 100644 --- a/pyEpiabm/pyEpiabm/core/cell.py +++ b/pyEpiabm/pyEpiabm/core/cell.py @@ -4,9 +4,9 @@ import typing import numpy as np +import re from queue import Queue from numbers import Number -import re from pyEpiabm.property import InfectionStatus from pyEpiabm.utility import DistanceFunctions From c718a9f96920b39d3d1e285295947ad8c960ca7e Mon Sep 17 00:00:00 2001 From: Abbie Evans Date: Wed, 22 Nov 2023 13:58:10 +0000 Subject: [PATCH 2/2] Updated set_id tests --- pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_household.py | 1 + pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_microcell.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_household.py b/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_household.py index c7db4ad53..b945d0811 100644 --- a/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_household.py +++ b/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_household.py @@ -65,6 +65,7 @@ def test_set_id(self): self.assertRaises(TypeError, subject.set_id, 2.0) self.assertRaises(ValueError, subject.set_id, "a.b.c") self.assertRaises(ValueError, subject.set_id, "0.0.") + self.assertRaises(ValueError, subject.set_id, "123") self.assertRaises(ValueError, subject.set_id, "0.0.0.0") diff --git a/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_microcell.py b/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_microcell.py index 25f800a81..763e6c88a 100644 --- a/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_microcell.py +++ b/pyEpiabm/pyEpiabm/tests/test_unit/test_core/test_microcell.py @@ -25,8 +25,11 @@ def test_repr(self): def test_set_id(self): self.assertEqual(self.microcell.id, self.cell.id + "." + str(len(self.cell.microcells))) + self.microcell.set_id("2.3") + self.assertEqual(self.microcell.id, "2.3") self.assertRaises(TypeError, self.microcell.set_id, 2.0) self.assertRaises(ValueError, self.microcell.set_id, "1.1.") + self.assertRaises(ValueError, self.microcell.set_id, "12") def test_add_person(self): self.assertEqual(len(self.microcell.persons), 0)