Merge lp:~mblayman/entertainer/224682-autosetup-config-dir into lp:~entertainer-releases/entertainer/devel

Proposed by Matt Layman
Status: Merged
Merge reported by: Paul Hummer
Merged at revision: 243
Proposed branch: lp:~mblayman/entertainer/224682-autosetup-config-dir
Merge into: lp:~entertainer-releases/entertainer/devel
To merge this branch: bzr merge lp:~mblayman/entertainer/224682-autosetup-config-dir
To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

This branch looks really good, and I think the one thing that could make it even better is some tests for it. Eventually, we're going to want to start gracefully handling out of date configuration files, and the tests would make this process very simple.

I will merge when acceptable tests are created

240. By Matt Layman

Added Configuration object test case. Modified configuration object so that it can be tested.

Revision history for this message
Matt Layman (mblayman) wrote :

Added the test case as requested. The configuration object could use a lot more tests, but I just created the starting place for all future tests and a test specifically for the auto-setup for the directory creation.

Revision history for this message
Paul Hummer (rockstar) wrote :

======================================================================
ERROR: Test Configuration object directory creation
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/rockstar/Projects/entertainer/devel/src/tests/Configuration_test.py", line 36, in setUp
    self.config = Configuration(self.cfg_dir)
  File "/home/rockstar/Projects/entertainer/devel/src/utils/configuration.py", line 47, in __init__
    self.create_cfg_dir()
  File "/home/rockstar/Projects/entertainer/devel/src/utils/configuration.py", line 71, in create_cfg_dir
    sys.exit(1)
SystemExit: 1

----------------------------------------------------------------------

Revision history for this message
Matt Layman (mblayman) wrote :

The test functions properly when run from the src level. I'm not sure how to resolve this so that it will run at the tests directory level because the create_cfg_dir uses an absolute path in order to find the cfg directory. Any suggestions on how to make this work from either level would be appreciated (I'm not sure how I could find the cfg directory without an absolute path that is determined relative to the source directory).

241. By Matt Layman

Fix configuration object to use __file__ instead of abspath

242. By Matt Layman

Just having src as the separator made me nervous so I added /utils to ensure that it is a lot more unlikely that the separator will be found too early in the path (e.g. /home/baduser_src/entertainer/src/utils/configuration.pyc will actually split where we want it too).

Subscribers

No one subscribed via source and target branches