diff --git a/src/edeposit/amqp/ltp/tests/unittests/test_init.py b/src/edeposit/amqp/ltp/tests/unittests/test_init.py index 8b433b9..4ca0bce 100755 --- a/src/edeposit/amqp/ltp/tests/unittests/test_init.py +++ b/src/edeposit/amqp/ltp/tests/unittests/test_init.py @@ -47,4 +47,21 @@ def test_create_package_hierarchy(): assert original_dir != metadata_dir if os.path.exists(root_dir): - shutil.rmtree(root_dir) \ No newline at end of file + shutil.rmtree(root_dir) + + +def test_get_localized_fn(): + local_path = ltp._get_localized_fn("/home/xex/somefile.txt", "/home") + assert local_path == "/xex/somefile.txt" + + local_path = ltp._get_localized_fn("/somefile.txt", "/") + assert local_path == "/somefile.txt" + + local_path = ltp._get_localized_fn("/xex/somefile.txt", "/home") + assert local_path == "/xex/somefile.txt" + + local_path = ltp._get_localized_fn("/home/xex/home/somefile.txt", "/home") + assert local_path == "/xex/home/somefile.txt" + + local_path = ltp._get_localized_fn("somefile.txt", "/azgabash") + assert local_path == "/somefile.txt"