Skip to content
Snippets Groups Projects
Commit 579bc96b authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

TST: modernize symlink test

parent 4c58307f
Branches
Tags
1 merge request!81F local inttests
......@@ -535,10 +535,9 @@ def test_insert_files_in_dir_with_symlink():
flags={
"InsertFilesInDir": path_on_server +
"linked_subfolder"})
assert_is_not_none(c.messages["Warning", 6])
assert_equal(c.messages["Warning", 6][0],
"Directory or file is symbolic link: " + path_on_server +
"linked_subfolder")
assert c.messages.get("Warning", 6, exact=True) is not None
assert (c.messages.get("Warning", 6, exact=True).description ==
"Directory or file is symbolic link: " + path_on_server + "linked_subfolder")
c = models.Container()
c.retrieve(
......@@ -548,11 +547,11 @@ def test_insert_files_in_dir_with_symlink():
"InsertFilesInDir": "--force-allow-symlinks " +
path_on_server +
"linked_subfolder"})
assert_is_not_none(c.messages["Info", 0])
assert_equal(c.messages["Info", 0][0],
"Files count in linked_subfolder/: 1")
assert c.messages.get("Info", 0, exact=True) is not None
assert c.messages.get(
"Info", 0, exact=True).description == "Files count in linked_subfolder/: 1"
assert c[0].name is None
assert_equal(c[0].path, "/linked_subfolder/test2.dat")
assert c[0].path == "/linked_subfolder/test2.dat"
d = models.Container()
d.insert(
......@@ -562,12 +561,12 @@ def test_insert_files_in_dir_with_symlink():
"InsertFilesInDir": "--force-allow-symlinks " +
path_on_server +
"linked_subfolder"})
assert_is_not_none(c.messages["Info", 0])
assert_equal(d.messages["Info", 0][0],
"Files count in linked_subfolder/: 1")
assert_true(d[0].is_valid())
assert d.messages.get("Info", 0, exact=True) is not None
assert d.messages.get(
"Info", 0, exact=True).description == "Files count in linked_subfolder/: 1"
assert d[0].is_valid() is True
assert d[0].name is None
assert_equal(d[0].path, "/linked_subfolder/test2.dat")
assert d[0].path == "/linked_subfolder/test2.dat"
finally:
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment