Esempio n. 1
0
 def test_list(self):
     '''
     Test xattr.list
     '''
     expected = {'spongebob': 'squarepants', 'squidward': 'patrick'}
     with patch.object(xattr, 'read',
                       MagicMock(side_effect=['squarepants', 'patrick'])):
         self.assertEqual(xattr.list_('path/to/file'), expected)
Esempio n. 2
0
 def test_list(self):
     '''
     Test xattr.list
     '''
     expected = {'spongebob': 'squarepants',
                 'squidward': 'patrick'}
     with patch.object(xattr, 'read', MagicMock(side_effect=['squarepants',
                                                             'patrick'])):
         self.assertEqual(xattr.list_('path/to/file'), expected)
Esempio n. 3
0
 def test_list(self):
     '''
     Test xattr.list
     '''
     expected = {'spongebob': 'squarepants', 'squidward': 'patrick'}
     with patch.object(xattr, 'read', MagicMock(side_effect=['squarepants',
                                                             'patrick'])), \
             patch('salt.utils.mac_utils.execute_return_result',
                   MagicMock(return_value='spongebob\nsquidward')):
         self.assertEqual(xattr.list_('path/to/file'), expected)
 def test_list(self):
     """
     Test xattr.list
     """
     expected = {"spongebob": "squarepants", "squidward": "patrick"}
     with patch.object(
             xattr, "read",
             MagicMock(side_effect=["squarepants", "patrick"])), patch(
                 "salt.utils.mac_utils.execute_return_result",
                 MagicMock(return_value="spongebob\nsquidward"),
             ):
         self.assertEqual(xattr.list_("path/to/file"), expected)