コード例 #1
0
ファイル: mac_package_test.py プロジェクト: bryson/salt
 def test_installed_pkgs(self):
     '''
         Test getting a list of the installed packages
     '''
     expected = ['com.apple.this', 'com.salt.that']
     mock = MagicMock(return_value='com.apple.this\ncom.salt.that')
     with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
         out = macpackage.installed_pkgs()
         mock.assert_called_once_with('pkgutil --pkgs')
         self.assertEqual(out, expected)
コード例 #2
0
ファイル: mac_package_test.py プロジェクト: xbglowx/salt
 def test_installed_pkgs(self):
     '''
         Test getting a list of the installed packages
     '''
     expected = ['com.apple.this', 'com.salt.that']
     mock = MagicMock(return_value='com.apple.this\ncom.salt.that')
     with patch.dict(macpackage.__salt__, {'cmd.run': mock}):
         out = macpackage.installed_pkgs()
         mock.assert_called_once_with('pkgutil --pkgs')
         self.assertEqual(out, expected)