def test_no_packages_manager(self, check_output_mock):
        """No packages manager is available at the moment..."""
        check_output_mock.side_effect = self._check_output_side_effect()

        packages = Packages()

        output_mock = MagicMock()
        packages.output(output_mock)

        self.assertIsNone(packages.value)
        self.assertEqual(output_mock.append.call_args[0][1],
                         DEFAULT_CONFIG['default_strings']['not_detected'])
示例#2
0
 def test_match_with_dpkg(self, _):
     """Simple test for the DPKG packages manager"""
     self.assertEqual(Packages().value, 6)
示例#3
0
 def test_match_with_apt(self, _):
     """Simple test for the APT packages manager"""
     self.assertEqual(Packages().value, 7)
示例#4
0
 def test_no_packages_manager(self, _, __):
     """No packages manager is available at the moment..."""
     self.assertEqual(Packages().value, 'Not detected')
示例#5
0
 def test_match_with_zypper(self, _):
     """Simple test for the Zypper packages manager"""
     self.assertEqual(Packages().value, 5)
    def test_match_with_dpkg(self, check_output_mock):
        """Simple test for the DPKG packages manager"""
        check_output_mock.side_effect = self._check_output_side_effect('dpkg')

        self.assertEqual(Packages().value, 6)
    def test_match_with_apk(self, check_output_mock):
        """Simple test for the APK packages manager"""
        check_output_mock.side_effect = self._check_output_side_effect('apk')

        self.assertEqual(Packages().value, 8)
    def test_match_with_pkg_info(self, check_output_mock):
        """Simple test for the OpenBSD `pkg_*` package manager"""
        check_output_mock.side_effect = self._check_output_side_effect(
            'pkg_info')

        self.assertEqual(Packages().value, 9)
 def test_multiple_package_managers(self, _):
     """Simple test for multiple packages managers"""
     self.assertEqual(Packages().value, 4)
    def test_match_with_zypper(self, check_output_mock):
        """Simple test for the Zypper packages manager"""
        check_output_mock.side_effect = self._check_output_side_effect(
            'zypper')

        self.assertEqual(Packages().value, 5)
    def test_match_with_yum(self, check_output_mock):
        """Simple test for the Yum packages manager"""
        check_output_mock.side_effect = self._check_output_side_effect('yum')

        self.assertEqual(Packages().value, 4)
    def test_match_with_macports(self, check_output_mock):
        """Simple test for the MacPorts CLI client (`port`) package manager"""
        check_output_mock.side_effect = self._check_output_side_effect('port')

        self.assertEqual(Packages().value, 14)
    def test_match_with_pkgin(self, check_output_mock):
        """Simple test for the (NetBSD) `pkgin` package manager"""
        check_output_mock.side_effect = self._check_output_side_effect('pkgin')

        self.assertEqual(Packages().value, 13)
    def test_match_with_pkg(self, check_output_mock, _):
        """Simple test for the FreeBSD `pkg` package manager"""
        check_output_mock.side_effect = self._check_output_side_effect('pkg')

        self.assertEqual(Packages().value, 8)
示例#15
0
 def test_match_with_emerge(self, _):
     """Simple test for the Emerge packages manager"""
     self.assertEqual(Packages().value, 5)
示例#16
0
 def test_match_with_pacman(self, _):
     """Simple test for the Pacman packages manager"""
     self.assertEqual(Packages().value, 4)
    def test_match_with_nix_env(self, check_output_mock):
        """Simple test for the Emerge packages manager"""
        check_output_mock.side_effect = self._check_output_side_effect(
            'nix-env')

        self.assertEqual(Packages().value, 4)