def test_config_fall_back(self, _, __):
        """`id` fails, but Archey must not !"""
        shell = Shell()

        output_mock = MagicMock()
        shell.output(output_mock)

        self.assertIsNone(shell.value)
        self.assertEqual(output_mock.append.call_args[0][1],
                         DEFAULT_CONFIG['default_strings']['not_detected'])
示例#2
0
 def test_getent_call(self, _, __, ___):
     """Mock `getent` returned value and check the correct assignment"""
     self.assertEqual(Shell().value, '/bin/bash')
示例#3
0
 def test_getenv(self, _):
     """Simple mock, simple test"""
     self.assertEqual(Shell().value, 'SHELL')
 def test_os_getuid_missing(self, _):
     """Check behavior when `os.getuid` is not available"""
     self.assertIsNone(Shell._query_name_service_switch())  # pylint: disable=protected-access
示例#5
0
 def test_config_fall_back(self, _, __, ___):
     """`id` fails, but Archey must not !"""
     self.assertEqual(Shell().value, 'Not detected')