Beispiel #1
0
 def test_infer_platform_windows(self, mock_system):
     mock_system.return_value = 'Windows'
     pltf = infer_platform('base', "4.2")
     self.assertEqual(pltf, 'windows_x86_64-2012plus')
     pltf = infer_platform('enterprise', "4.2")
     self.assertEqual(pltf, 'windows')
     pltf = infer_platform('base', "4.0")
     self.assertEqual(pltf, 'windows')
     pltf = infer_platform(None, "4.2")
     self.assertEqual(pltf, 'windows')
     pltf = infer_platform('base', None)
     self.assertEqual(pltf, 'windows')
     pltf = infer_platform(None, None)
     self.assertEqual(pltf, 'windows')
Beispiel #2
0
 def test_infer_platform_darwin(self, mock_system):
     mock_system.return_value = 'Darwin'
     pltf = infer_platform('base', "4.2")
     self.assertEqual(pltf, 'osx')
     pltf = infer_platform('enterprise', "4.2")
     self.assertEqual(pltf, 'osx')
     pltf = infer_platform('base', "4.0")
     self.assertEqual(pltf, 'osx')
     pltf = infer_platform(None, "4.2")
     self.assertEqual(pltf, 'osx')
     pltf = infer_platform('base', None)
     self.assertEqual(pltf, 'osx')
     pltf = infer_platform(None, None)
     self.assertEqual(pltf, 'osx')
Beispiel #3
0
    def test_infer_platform_linux(self, mock_system, mock_id, mock_major, mock_minor):
        mock_system.return_value = 'Linux'
        mock_id.return_value = 'ubuntu'
        mock_major.return_value = '18'
        mock_minor.return_value = '04'
        pltf = infer_platform('base', "4.2")
        self.assertEqual(pltf, 'ubuntu1804')
        pltf = infer_platform('enterprise', "4.2")
        self.assertEqual(pltf, 'ubuntu1804')
        pltf = infer_platform('base', "4.0")
        self.assertEqual(pltf, 'ubuntu1804')
        pltf = infer_platform(None, "4.2")
        self.assertEqual(pltf, 'ubuntu1804')
        pltf = infer_platform('base', None)
        self.assertEqual(pltf, 'ubuntu1804')
        pltf = infer_platform(None, None)
        self.assertEqual(pltf, 'ubuntu1804')

        mock_id.return_value = 'rhel'
        mock_major.return_value = '8'
        mock_minor.return_value = '0'
        pltf = infer_platform('base', "4.2")
        self.assertEqual(pltf, 'rhel80')
        pltf = infer_platform('enterprise', "4.2")
        self.assertEqual(pltf, 'rhel80')
        pltf = infer_platform('base', "4.0")
        self.assertEqual(pltf, 'rhel80')
        pltf = infer_platform(None, "4.2")
        self.assertEqual(pltf, 'rhel80')
        pltf = infer_platform('base', None)
        self.assertEqual(pltf, 'rhel80')
        pltf = infer_platform(None, None)
        self.assertEqual(pltf, 'rhel80')