def test_abspath_get_mapped_url(local_v6_txt): u = AbsPath(local_v6_txt) dirname = os.path.dirname(local_v6_txt) basename = os.path.basename(local_v6_txt) url_prefix = "http://my.test.com" AbsPath.init_abspath(map_path_to_url={dirname: url_prefix}) assert u.get_mapped_url() == os.path.join(url_prefix, basename) AbsPath.init_abspath(map_path_to_url=dict()) assert u.get_mapped_url() is None
def test_abspath_get_loc_prefix() -> str: test_loc_prefix = "test_abspath_get_loc_prefix" AbsPath.init_abspath(loc_prefix=test_loc_prefix) assert AbsPath.get_loc_prefix() == test_loc_prefix AbsPath.init_abspath(loc_prefix="") assert AbsPath.get_loc_prefix() == ""