From 7e2b822d04dcc5482eabcc79ac1fe76bc42a6ece Mon Sep 17 00:00:00 2001
From: dh00601 <dh00601@surrey.ac.uk>
Date: Sun, 9 Jan 2022 12:10:15 +0000
Subject: [PATCH] working on ensemble tests

---
 binarycpython/tests/test_ensemble.py | 34 ++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/binarycpython/tests/test_ensemble.py b/binarycpython/tests/test_ensemble.py
index 32128c72f..169729eb8 100644
--- a/binarycpython/tests/test_ensemble.py
+++ b/binarycpython/tests/test_ensemble.py
@@ -152,7 +152,7 @@ class test_extract_ensemble_json_from_string(unittest.TestCase):
 
     def test_2(self):
         with Capturing() as _:
-            self._test_1()
+            self._test_2()
 
     def _test_2(self):
         """
@@ -170,7 +170,7 @@ class test_extract_ensemble_json_from_string(unittest.TestCase):
 
     def test_3(self):
         with Capturing() as _:
-            self._test_1()
+            self._test_3()
 
     def _test_3(self):
         """
@@ -183,11 +183,11 @@ class test_extract_ensemble_json_from_string(unittest.TestCase):
         self.assertTrue(isinstance(output_1, dict))
         self.assertEqual(output_1, {})
 
-    def test_3(self):
+    def test_4(self):
         with Capturing() as _:
-            self._test_1()
+            self._test_4()
 
-    def test_3(self):
+    def test_4(self):
         """
         Simple test with missing starting string
         """
@@ -214,6 +214,18 @@ class test_load_ensemble(unittest.TestCase):
         """
         super(test_load_ensemble, self).__init__(*args, **kwargs)
 
+        #
+        self.run_population()
+
+    def run_population(self):
+        with Capturing() as _:
+            self._run_population()
+
+    def _run_population(self):
+        """
+        Function to run the population to create the ensemble files
+        """
+
         # First
         test_pop_1 = Population()
         test_pop_1.set(
@@ -374,6 +386,18 @@ class test_open_ensemble(unittest.TestCase):
         """
         super(test_open_ensemble, self).__init__(*args, **kwargs)
 
+        #
+        self.run_population()
+
+    def run_population(self):
+        with Capturing() as _:
+            self._run_population()
+
+    def _run_population(self):
+        """
+        Function to run the population to create the ensemble files
+        """
+
         # First
         test_pop_1 = Population()
         test_pop_1.set(
-- 
GitLab