Skip to content

Commit

Permalink
#1, #9: Added tests of the _get_localized_fn().
Browse files Browse the repository at this point in the history
  • Loading branch information
Bystroushaak committed Oct 6, 2014
1 parent 23020b8 commit a56a66d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/edeposit/amqp/ltp/tests/unittests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,21 @@ def test_create_package_hierarchy():
assert original_dir != metadata_dir

if os.path.exists(root_dir):
shutil.rmtree(root_dir)
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"

0 comments on commit a56a66d

Please sign in to comment.