def test_requirements_file(): python.installation() document("requirements.txt", source="tests/files/requirements.txt") with python.virtualenv("_env"): python.packages("requirements.txt") for line in open("tests/files/requirements.txt"): assert_in(line.strip(), run("pip freeze"))
def test_document_owner(): user("foo") document("foobar", owner="foo") assert_equals(sudo('stat -c "%U" foobar'), "foo") user("foo", state="deleted")
def test_document_create(): document("foobar") sudo("test -f foobar")
def test_document_delete(): document("foobar", state="deleted") sudo("test ! -f foobar")
def test_document_create_contents(): document("foobar", source="tests/files/hello.txt") contents = sudo("cat foobar") assert_equals(contents, "Hello World")
def test_document_create_mode(): document("foobar", mode=0600) assert_equals(sudo('stat -c "%a" foobar'), "600")
def test_document_invalid_path(): document("foobar", source="foo/bar/man.txt")
def test_document_user(): user("foo") document("bat", group="foo") assert_equals(sudo('stat -c "%G" bat'), "foo") user("foo", state="deleted")
def test_link_create(): document("foobar") link("foobar", "bar") run("test -L bar")
def test_document_invalid_state(): document("foobar", state="foobar")
def test_document_directory(): document("foobar", source="tests")