def test_get_udf_path(self): """Test for get_udf_path.""" suggested_path = u"suggested_path" udf_path = get_udf_path(u"~/" + suggested_path) self.assertEqual( os.path.join(self.home_dir, suggested_path.encode('utf-8')), udf_path)
def _create_udf(self, suggested_path=None, subscribed=True): """Create an UDF and returns it and the volume""" volume_id = 'volume_id' node_id = 'node_id' if suggested_path is None: suggested_path = u'~/ñoño' else: assert isinstance(suggested_path, unicode) path = volume_manager.get_udf_path(suggested_path) udf = volume_manager.UDF(str(volume_id), str(node_id), suggested_path, path, subscribed) return udf