Tests should automatically create the remote directory if it doesn't exist
Created by: player1537
- Django Remote Submission version: 0.6.0
- Django version: N/A
- Python version: N/A
- Operating System: N/A
Description
The tests should automatically create the TEST_REMOTE_DIRECTORY
if it doesn't already exist. I think we had code that did this already, but it either got lost somewhere or is part of the code for the users of the library rather than in the library itself.
Additionally, the documentation for TEST_REMOTE_DIRECTORY
in .env.base
will need to be updated once this is finished.
What I Did
$ git clone <this repo>
$ cp .env.base .env
$ vi .env
$ cat .env
...
# The remote directory to store scripts in. Ideally this directory will already
# exist, though if it doesn't then the tests should create it.
#
# Also note that if this directory is used by other things, it could make the
# tests fail. For example, if you use /tmp/ as the remote directory and a root
# process writes something to /tmp/ while a test is running, the test will
# likely error because it doesn't have read permissions on that file.
#
# Type: String
# Example(s):
# TEST_REMOTE_DIRECTORY=/tmp/django-remote-submission/
#
TEST_REMOTE_DIRECTORY=/tmp/does-not-exist/
...
$ python3 -m virtualenv venv
$ source venv/bin/activate
(venv)$ python3 -m pip install -r requirements_test.txt
(venv)$ make test
The tests will currently fail because /tmp/does-not-exist/
does not exist and isn't automatically created.