Issue #1230
closedAbility to run unit tests on a system without pulp-server installed
Description
Trying to run the unit tests on a Fedora system without pulp installed, I get errors trying to read /etc/pulp/server.conf, which clearly doesn't exist.
For the tests for the plugin I'm working on, I had to mock the whole config module, and it's not pretty; the reason is that even importing the config module will attempt to read that configuration file.
I think it's reasonable to not fail if the configuration file is missing. It is also reasonable to not rely on the host's configuration when running the testsuite from a git checkout.
For example:
python -c "from pulp.server import config"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 154, in <module>
load_configuration()
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 113, in load_configuration
check_config_files()
File "/usr/lib/python2.7/site-packages/pulp/server/config.py", line 105, in check_config_files
raise RuntimeError('Cannot read configuration file: %s' % config_file)
RuntimeError: Cannot read configuration file: /etc/pulp/server.conf
Related issues
Updated by mhrivnak over 9 years ago
- Severity changed from 2. Medium to 1. Low
- Triaged changed from No to Yes
Updated by rbarlow over 9 years ago
- Is duplicate of Task #413: Our unit tests require read permissions on server.conf added
Updated by rbarlow over 9 years ago
- Status changed from NEW to CLOSED - DUPLICATE