diff --git a/tests/test_controller/test_processing.py b/tests/test_controller/test_processing.py index 289eb5bbdfc516f1a3b6d925e15c507415359b75..74751b31bec8a04c43f6a063599452a6ee5ff5eb 100644 --- a/tests/test_controller/test_processing.py +++ b/tests/test_controller/test_processing.py @@ -161,8 +161,7 @@ class TestLoadDataAndReadChannels(TestCase): self.assertIsNone(load_data('RT130', None, [q330_dir], [])) output = f.getvalue() self.assertIn( - f"Dir {q330_dir} " - f"can't be read due to error: Traceback", + "Data can't be read due to error: Traceback", output ) with redirect_stdout(f): @@ -170,8 +169,7 @@ class TestLoadDataAndReadChannels(TestCase): load_data(self.mseed_dtype, None, [rt130_dir], [])) output = f.getvalue() self.assertIn( - f"Dir {rt130_dir} " - f"can't be read due to error: Traceback", + "Data can't be read due to error: Traceback", output ) @@ -354,10 +352,9 @@ class TestDetectDataType(TestCase): detect_data_type([self.dir1.name, self.dir2.name]) self.assertEqual( str(context.exception), - f"There are more than one types of data detected:\n" - f"{self.dir1.name}: [RT130, _]\n" - f"{self.dir2.name}: [Q330, VEP]\n\n" - f"Please have only data that related to each other.") + "There are more than one types of data detected:\n" + "Q330, RT130\n\n" + "Please have only one data type for each loading.") def test_unknown_data_type(self): """ diff --git a/tests/test_controller/test_util.py b/tests/test_controller/test_util.py index e58e8c89b84a1a580991722f73490b2787c75ad8..83bfa68850f1544a045e60123add9037b238c30d 100644 --- a/tests/test_controller/test_util.py +++ b/tests/test_controller/test_util.py @@ -11,6 +11,7 @@ import string from sohstationviewer.controller.util import ( validate_file, validate_dir, + get_total_files, get_dir_size, get_time_6, get_time_6_2y, @@ -202,6 +203,14 @@ class TestValidateDir(TestCase): self.fail() +class TestGetTotalFiles(TestCase): + def test_get_total_files(self): + list_of_dir = [os.path.join(TEST_DATA_DIR, 'Centaur-sample'), + os.path.join(TEST_DATA_DIR, 'Q330-sample')] + total_files = get_total_files(list_of_dir) + self.assertEqual(total_files, 6) + + class TestGetDirSize(TestCase): """Test suite for get_dir_size.""" def test_files_have_size_zero(self):