def test_fetch_darwin_release(self, _, __):
     """Test `_fetch_darwin_release` static method"""
     self.assertEqual(
         Distro._fetch_darwin_release(),  # pylint: disable=protected-access
         'Darwin 20.2.0')
     self.assertEqual(
         Distro._fetch_darwin_release(),  # pylint: disable=protected-access
         'macOS 11.1')
    def test_unknown_distro_output(self):
        """Test for `output` method when distribution name couldn't be found"""
        distro_intance_mock = HelperMethods.entry_mock(Distro)
        output_mock = MagicMock()

        distro_intance_mock.value = {'name': None, 'arch': 'ARCHITECTURE'}

        Distro.output(distro_intance_mock, output_mock)
        self.assertEqual(
            output_mock.append.call_args[0][1],
            f"{DEFAULT_CONFIG['default_strings']['not_detected']} [ARCHITECTURE]"
        )
Пример #3
0
    def test_unknown_distro_output(self, _, __, ___):
        """Test for `distro` and `uname` outputs concatenation"""
        distro = Distro()

        output_mock = MagicMock()
        distro.output(output_mock)

        self.assertDictEqual(distro.value, {
            'name': None,
            'arch': 'ARCHITECTURE'
        })
        self.assertEqual(
            output_mock.append.call_args[0][1],
            DEFAULT_CONFIG['default_strings']['not_detected'] +
            ' [ARCHITECTURE]')
Пример #4
0
 def test(self, _, __):
     """Test for `distro` and `uname` outputs concatenation"""
     self.assertEqual(Distro().value,
                      'NAME VERSION (CODENAME) [ARCHITECTURE]')
 def test_fetch_android_release(self, _):
     """Test `_fetch_android_release` static method"""
     self.assertEqual(
         Distro._fetch_android_release(),  # pylint: disable=protected-access
         'Android 10')
Пример #6
0
 def test_fetch_architecture(self, _):
     """Test `_fetch_architecture` static method"""
     self.assertEqual(
         Distro._fetch_architecture(),  # pylint: disable=protected-access
         'x86_64')
Пример #7
0
 def test_init(self, _, __):
     """Test `Distro` instantiation"""
     self.assertDictEqual(Distro().value, {
         'name': 'NAME VERSION (CODENAME)',
         'arch': 'ARCHITECTURE'
     })
Пример #8
0
 def test_unknown_distro(self, _, __, ___):
     """Test for `distro` and `uname` outputs concatenation"""
     self.assertEqual(Distro().value, 'Not detected [ARCHITECTURE]')