示例#1
0
    def setUp(self):
        super(TestOSUtils, self).setUp()

        self.base_os_util = osutils.BaseOS('unknown')

        with mock.patch('distro.id', return_value='ubuntu'):
            self.ubuntu_os_util = osutils.BaseOS.get_os_util()

        with mock.patch('distro.id', return_value='centos'):
            self.rh_os_util = osutils.BaseOS.get_os_util()
示例#2
0
    def setUp(self):
        super(TestOSUtils, self).setUp()

        self.base_os_util = osutils.BaseOS('unknown')

        with mock.patch('platform.linux_distribution',
                        return_value=['Ubuntu', 'Foo', 'Bar']):
            self.ubuntu_os_util = osutils.BaseOS.get_os_util()

        with mock.patch('platform.linux_distribution',
                        return_value=['centos', 'Foo', 'Bar']):
            self.rh_os_util = osutils.BaseOS.get_os_util()
示例#3
0
    def setUp(self):
        super().setUp()

        self.base_os_util = osutils.BaseOS('unknown')

        with mock.patch('distro.id', return_value='ubuntu'):
            self.ubuntu_os_util = osutils.BaseOS.get_os_util()

        with mock.patch('distro.id', return_value='rhel'):
            self.rh_os_util = osutils.BaseOS.get_os_util()

        with mock.patch('distro.id', return_value='centos'):
            with mock.patch('distro.version', return_value='8'):
                self.centos_os_util = osutils.BaseOS.get_os_util()

        with mock.patch('distro.id', return_value='centos'):
            with mock.patch('distro.version', return_value='7'):
                self.centos7_os_util = osutils.BaseOS.get_os_util()