def test_subvolume_get_default_free(self): """ Test btrfs subvolume get-default """ salt_mock = { "cmd.run_all": MagicMock( return_value={"recode": 0, "stdout": "ID 5 (FS_TREE)"} ), } with patch.dict(btrfs.__salt__, salt_mock): assert btrfs.subvolume_get_default("/mnt") == { "id": "5", "name": "(FS_TREE)", } salt_mock["cmd.run_all"].assert_called_once() salt_mock["cmd.run_all"].assert_called_with( ["btrfs", "subvolume", "get-default", "/mnt"] )
def test_subvolume_get_default(self): ''' Test btrfs subvolume get-default ''' salt_mock = { 'cmd.run_all': MagicMock(return_value={ 'recode': 0, 'stdout': 'ID 257 gen 8 top level 5 path var', }), } with patch.dict(btrfs.__salt__, salt_mock): assert btrfs.subvolume_get_default('/mnt') == { 'id': '257', 'name': 'var', } salt_mock['cmd.run_all'].assert_called_once() salt_mock['cmd.run_all'].assert_called_with( ['btrfs', 'subvolume', 'get-default', '/mnt'])
def test_subvolume_get_default(self): """ Test btrfs subvolume get-default """ salt_mock = { "cmd.run_all": MagicMock(return_value={ "recode": 0, "stdout": "ID 257 gen 8 top level 5 path var", }), } with patch.dict(btrfs.__salt__, salt_mock): assert btrfs.subvolume_get_default("/mnt") == { "id": "257", "name": "var", } salt_mock["cmd.run_all"].assert_called_once() salt_mock["cmd.run_all"].assert_called_with( ["btrfs", "subvolume", "get-default", "/mnt"])