Skip to content

Commit 726d0a4

Browse files
committed
Uncomment a test that now succeeds
Note that the test code required a little tweaking before it could succeed due to pytest-dev/pytest-testinfra#766.
1 parent 964381f commit 726d0a4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Diff for: molecule/default/tests/test_default.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,16 @@ def test_extra_files_do_not_exist(host, d, count):
5656
assert len(host.file(d).listdir()) == count
5757

5858

59-
# This test is commented out until #29 is resolved.
60-
# def test_symlink_exists(host):
61-
# """Test that the file share symlink exists for the test user.
62-
63-
# Note that this test is dependent on the side_effect playbook being
64-
# run.
65-
# """
66-
# f = host.file("/home/test/Desktop/share")
67-
# assert f.exists
68-
# assert f.is_symlink
69-
# assert f.linked_to == "/share"
70-
# assert f.user == "test"
71-
# assert f.group == "test"
59+
def test_symlink_exists(host):
60+
"""Test that the file share symlink exists for the test user."""
61+
share_symlink_location = "/home/test/Desktop/share"
62+
f = host.file(share_symlink_location)
63+
assert f.exists
64+
assert f.is_symlink
65+
assert f.linked_to == "/share"
66+
# f.user and f.group return the user and group, respectively, of the
67+
# symlink target. I have to use stat because I want to actually check the
68+
# user and group of the symlink itself. See
69+
# pytest-dev/pytest-testinfra#766 for more details.
70+
assert host.check_output("stat --format %%U %s", share_symlink_location) == "test"
71+
assert host.check_output("stat --format %%G %s", share_symlink_location) == "test"

0 commit comments

Comments
 (0)