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

TST: modernize symlink test

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