예제 #1
0
 def test_resize(self):
     '''
     Test if it resize filesystem.
     '''
     mock = MagicMock(return_value={'retcode': 1,
                                    'stderr': '',
                                    'stdout': 'Salt'})
     mock_info = MagicMock(return_value=[])
     with patch.dict(btrfs.__salt__, {'cmd.run_all': mock,
                                      'btrfs.info': mock_info}):
         mock = MagicMock(return_value={'/dev/sda1': True})
         with patch.object(salt.utils.fsutils, '_get_mounts', mock):
             self.assertDictEqual(btrfs.resize('/dev/sda1', 'max'),
                                  {'log': 'Salt'})
예제 #2
0
파일: btrfs_test.py 프로젝트: DaveQB/salt
 def test_resize(self):
     '''
     Test if it resize filesystem.
     '''
     mock = MagicMock(return_value={'retcode': 1,
                                    'stderr': '',
                                    'stdout': 'Salt'})
     mock_info = MagicMock(return_value=[])
     with patch.dict(btrfs.__salt__, {'cmd.run_all': mock,
                                      'btrfs.info': mock_info}):
         mock = MagicMock(return_value={'/dev/sda1': True})
         with patch.object(salt.utils.fsutils, '_get_mounts', mock):
             self.assertDictEqual(btrfs.resize('/dev/sda1', 'max'),
                                  {'log': 'Salt'})
예제 #3
0
 def test_resize(self):
     """
     Test if it resize filesystem.
     """
     with patch("salt.utils.fsutils._is_device", MagicMock(return_value=True)):
         mock = MagicMock(
             return_value={"retcode": 1, "stderr": "", "stdout": "Salt"}
         )
         mock_info = MagicMock(return_value=[])
         with patch.dict(
             btrfs.__salt__, {"cmd.run_all": mock, "btrfs.info": mock_info}
         ):
             mock = MagicMock(return_value={"/dev/sda1": True})
             with patch.object(salt.utils.fsutils, "_get_mounts", mock):
                 self.assertDictEqual(
                     btrfs.resize("/dev/sda1", "max"), {"log": "Salt"}
                 )