def test_zfs_join_pool_volume_empty_params(self): """ zfs._join_pool_volume raises ValueError on invalid volume """ with self.assertRaises(ValueError): zfs._join_pool_volume('', '')
def test_zfs_join_pool_volume_invalid_volume(self): """ zfs._join_pool_volume raises ValueError on invalid volume """ with self.assertRaises(ValueError): zfs._join_pool_volume('rpool', None)
def test_zfs_join_pool_volume_invalid_pool(self): """ zfs._join_pool_volume raises ValueError on invalid pool """ with self.assertRaises(ValueError): zfs._join_pool_volume(None, 'myvol')
def test_zfs_join_pool_volume_no_slash(self): """ zfs._join_pool_volume handles no slash """ pool = 'rpool' volume = 'ROOT' self.assertEqual('rpool/ROOT', zfs._join_pool_volume(pool, volume))
def test_zfs_join_pool_volume_extra_slash(self): """ zfs._join_pool_volume removes extra slashes """ pool = 'wark' volume = '//myvol/fs//foobar' self.assertEqual('wark/myvol/fs/foobar', zfs._join_pool_volume(pool, volume))
def test_zfs_join_pool_volume(self): """ zfs._join_pool_volume combines poolname and volume """ pool = 'mypool' volume = '/myvolume' self.assertEqual('mypool/myvolume', zfs._join_pool_volume(pool, volume))