diff --git a/archey/test/entries/test_archey_load_average.py b/archey/test/entries/test_archey_load_average.py index 8a8e4a2c..38423f22 100644 --- a/archey/test/entries/test_archey_load_average.py +++ b/archey/test/entries/test_archey_load_average.py @@ -23,16 +23,9 @@ def test_pretty_value_coloration(self): "danger_threshold": 2.25, } - self.assertListEqual( - list(self.load_average_mock), - [ - ( - self.load_average_mock.name, - f"{Colors.GREEN_NORMAL}0.5{Colors.CLEAR} " - f"{Colors.YELLOW_NORMAL}1.25{Colors.CLEAR} " - f"{Colors.RED_NORMAL}2.5{Colors.CLEAR}", - ) - ], + self.assertEqual( + str(self.load_average_mock), + f"{Colors.GREEN_NORMAL}0.5{Colors.CLEAR} {Colors.YELLOW_NORMAL}1.25{Colors.CLEAR} {Colors.RED_NORMAL}2.5{Colors.CLEAR}", ) @HelperMethods.patch_clean_configuration @@ -46,16 +39,9 @@ def test_pretty_value_rounding(self): "warning_threshold": 5, "danger_threshold": 5, } - self.assertListEqual( - list(self.load_average_mock), - [ - ( - self.load_average_mock.name, - f"{Colors.GREEN_NORMAL}0.0{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}1.0{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", - ) - ], + self.assertEqual( + str(self.load_average_mock), + f"{Colors.GREEN_NORMAL}0.0{Colors.CLEAR} {Colors.GREEN_NORMAL}1.0{Colors.CLEAR} {Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", ) with self.subTest("1 decimal place"): @@ -64,16 +50,9 @@ def test_pretty_value_rounding(self): "warning_threshold": 5, "danger_threshold": 5, } - self.assertListEqual( - list(self.load_average_mock), - [ - ( - self.load_average_mock.name, - f"{Colors.GREEN_NORMAL}0.3{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}1.2{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", - ) - ], + self.assertEqual( + str(self.load_average_mock), + f"{Colors.GREEN_NORMAL}0.3{Colors.CLEAR} {Colors.GREEN_NORMAL}1.2{Colors.CLEAR} {Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", ) with self.subTest("2 decimal places"): @@ -82,16 +61,9 @@ def test_pretty_value_rounding(self): "warning_threshold": 5, "danger_threshold": 5, } - self.assertListEqual( - list(self.load_average_mock), - [ - ( - self.load_average_mock.name, - f"{Colors.GREEN_NORMAL}0.33{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}1.25{Colors.CLEAR} " - f"{Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", - ) - ], + self.assertEqual( + str(self.load_average_mock), + f"{Colors.GREEN_NORMAL}0.33{Colors.CLEAR} {Colors.GREEN_NORMAL}1.25{Colors.CLEAR} {Colors.GREEN_NORMAL}2.0{Colors.CLEAR}", ) diff --git a/archey/test/entries/test_archey_model.py b/archey/test/entries/test_archey_model.py index 8cff93c4..ef95503f 100644 --- a/archey/test/entries/test_archey_model.py +++ b/archey/test/entries/test_archey_model.py @@ -249,10 +249,6 @@ def test_no_match(self): """Test when no information could be retrieved""" model_instance_mock = HelperMethods.entry_mock(Model) self.assertIsNone(model_instance_mock.value) - self.assertListEqual( - list(model_instance_mock), - [(model_instance_mock.name, None)], - ) @patch( "archey.entries.model.check_output", diff --git a/archey/test/entries/test_archey_packages.py b/archey/test/entries/test_archey_packages.py index 3666b38f..3aa626be 100644 --- a/archey/test/entries/test_archey_packages.py +++ b/archey/test/entries/test_archey_packages.py @@ -305,10 +305,6 @@ def test_no_packages_manager(self, check_output_mock): packages = Packages() self.assertIsNone(packages.value) - self.assertListEqual( - list(packages), - [(packages.name, None)], - ) @staticmethod def _check_output_side_effect(pkg_manager_cmd=None): diff --git a/archey/test/entries/test_archey_ram.py b/archey/test/entries/test_archey_ram.py index b4bcd5e5..b43b7a34 100644 --- a/archey/test/entries/test_archey_ram.py +++ b/archey/test/entries/test_archey_ram.py @@ -127,11 +127,8 @@ def test_various_output_configuration(self): """Test output overloading based on user preferences""" ram_instance_mock = HelperMethods.entry_mock(RAM) - with self.subTest("Output in case of non-detection."): - self.assertListEqual( - list(ram_instance_mock), - [(ram_instance_mock.name, None)], - ) + with self.subTest("In case of non-detection."): + self.assertIsNone(ram_instance_mock.value) with self.subTest('"Normal" output (green).'): ram_instance_mock.value = { @@ -143,14 +140,9 @@ def test_various_output_configuration(self): "warning_use_percent": 33.3, "danger_use_percent": 66.7, } - self.assertListEqual( - list(ram_instance_mock), - [ - ( - ram_instance_mock.name, - f"{Colors.GREEN_NORMAL}2043 MiB{Colors.CLEAR} / 15658 MiB", - ) - ], + self.assertEqual( + str(ram_instance_mock), + f"{Colors.GREEN_NORMAL}2043 MiB{Colors.CLEAR} / 15658 MiB", ) with self.subTest('"Danger" output (red).'): @@ -163,14 +155,9 @@ def test_various_output_configuration(self): "warning_use_percent": 25, "danger_use_percent": 50, } - self.assertListEqual( - list(ram_instance_mock), - [ - ( - ram_instance_mock.name, - f"{Colors.RED_NORMAL}7830 MiB{Colors.CLEAR} / 15658 MiB", - ) - ], + self.assertEqual( + str(ram_instance_mock), + f"{Colors.RED_NORMAL}7830 MiB{Colors.CLEAR} / 15658 MiB", ) diff --git a/archey/test/entries/test_archey_shell.py b/archey/test/entries/test_archey_shell.py index c6d48d59..ebd85e74 100644 --- a/archey/test/entries/test_archey_shell.py +++ b/archey/test/entries/test_archey_shell.py @@ -59,10 +59,6 @@ def test_config_fall_back(self, _, __): """`id` fails, but Archey must not !""" shell = Shell() self.assertIsNone(shell.value) - self.assertListEqual( - list(shell), - [(shell.name, None)], - ) if __name__ == "__main__": diff --git a/archey/test/entries/test_archey_temperature.py b/archey/test/entries/test_archey_temperature.py index b6cc16b5..5f67c261 100644 --- a/archey/test/entries/test_archey_temperature.py +++ b/archey/test/entries/test_archey_temperature.py @@ -335,10 +335,7 @@ def test_run_vcgencmd(self, _): def test_output(self): """Test output values""" # No value --> `None`. - self.assertListEqual( - list(self.temperature_mock), - [(self.temperature_mock.name, None)], - ) + self.assertIsNone(self.temperature_mock.value) # Values --> normal behavior. self.temperature_mock._temps = [50.0, 40.0, 50.0] # pylint: disable=protected-access @@ -348,9 +345,9 @@ def test_output(self): "char_before_unit": "o", "unit": "C", } - self.assertListEqual( - list(self.temperature_mock), - [(self.temperature_mock.name, "46.7oC (Max. 50.0oC)")], + self.assertEqual( + str(self.temperature_mock), + "46.7oC (Max. 50.0oC)", ) # Only one value --> no maximum. @@ -361,10 +358,7 @@ def test_output(self): "char_before_unit": " ", "unit": "C", } - self.assertListEqual( - list(self.temperature_mock), - [(self.temperature_mock.name, "42.8 C")], - ) + self.assertEqual(str(self.temperature_mock), "42.8 C") def test_convert_to_fahrenheit(self): """Simple tests for the `_convert_to_fahrenheit` static method"""