示例#1
0
 def test_properties(self):
     '''
     Test if list properties for given btrfs object
     '''
     mock = MagicMock(return_value={'retcode': 1,
                                    'stderr': '',
                                    'stdout': 'Salt'})
     with patch.dict(btrfs.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(btrfs.properties('/dev/sda1', 'subvol'), {})
示例#2
0
文件: btrfs_test.py 项目: DaveQB/salt
 def test_properties(self):
     '''
     Test if list properties for given btrfs object
     '''
     mock = MagicMock(return_value={'retcode': 1,
                                    'stderr': '',
                                    'stdout': 'Salt'})
     with patch.dict(btrfs.__salt__, {'cmd.run_all': mock}):
         self.assertDictEqual(btrfs.properties('/dev/sda1', 'subvol'), {})
示例#3
0
 def test_properties(self):
     """
     Test if list properties for given btrfs object
     """
     with patch("salt.utils.fsutils._verify_run", MagicMock(return_value=True)):
         mock = MagicMock(
             return_value={"retcode": 1, "stderr": "", "stdout": "Salt"}
         )
         with patch.dict(btrfs.__salt__, {"cmd.run_all": mock}):
             self.assertDictEqual(btrfs.properties("/dev/sda1", "subvol"), {})