Permalink
Browse files

upgrade tests to reflect new playdoh which uses a directory called se…

…ttings. Also added options to run tox with a different git repo and branch
  • Loading branch information...
1 parent 3e3061d commit cb0ec40230a0eb35357f10813b47062dd0e357df @peterbe peterbe committed Oct 27, 2011
Showing with 20 additions and 5 deletions.
  1. +1 −0 .gitignore
  2. +10 −0 README.rst
  3. +9 −5 tests/__init__.py
View
@@ -4,3 +4,4 @@
.nose*
.playdoh
.tox
+funfactory.egg-info/
View
@@ -19,6 +19,10 @@ and type the ``tox`` command. The ``tox.ini`` will handle the rest.
.. _`tox`: http://tox.readthedocs.org/
+Note: if you supply a different playdoh remote URL or a different
+branch or something, remember to delete the ``.playdoh/`` directory
+between tests for a clean slate.
+
To try out cutting edge funfactory features in a real playdoh app, you can use
the develop command to install a link to the files within your virtualenv::
@@ -40,3 +44,9 @@ Here are some environment variables that are acknowledged by the test suite:
**FF_DB_NAME**
MySQL db name for manage.py test. Defaults to ``_funfactory_test``.
+
+**FF_PLAYDOH_REMOTE**
+ Git qualified URL for playdoh repo. Defaults to ``git://github.com/mozilla/playdoh.git``.
+
+**FF_PLAYDOH_BRANCH**
+ Default branch to pull and update. Defaults to ``base``.
View
@@ -16,6 +16,9 @@
DB_USER = os.environ.get('FF_DB_USER', 'root')
DB_PASS = os.environ.get('FF_DB_PASS', '')
DB_NAME = os.environ.get('FF_DB_NAME', '_funfactory_test')
+FF_PLAYDOH_REMOTE = os.environ.get('PLAYDOH_REMOTE',
+ 'git://github.com/mozilla/playdoh.git')
+FF_PLAYDOH_BRANCH = os.environ.get('PLAYDOH_BRANCH', 'base')
def test_root():
@@ -44,18 +47,19 @@ def begin(self):
if not os.path.exists(container):
os.mkdir(container)
check_call(['git', 'clone', '--recursive',
- 'git://github.com/mozilla/playdoh.git',
+ '--branch', FF_PLAYDOH_BRANCH,
+ FF_PLAYDOH_REMOTE,
PLAYDOH])
else:
proj_sh = partial(shell, cwd=PLAYDOH)
- proj_sh('git pull origin base')
+ proj_sh('git pull origin %s' % FF_PLAYDOH_BRANCH)
proj_sh('git submodule sync -q')
proj_sh('git submodule update --init --recursive')
- st = os.path.join(PLAYDOH, 'settings_local.py')
+ st = os.path.join(PLAYDOH, 'settings', 'local.py')
if os.path.exists(st):
os.unlink(st)
- shutil.copy(os.path.join(PLAYDOH, 'settings_local.py-dist'),
+ shutil.copy(os.path.join(PLAYDOH, 'settings', 'local.py-dist'),
st)
with open(st, 'r') as f:
@@ -68,7 +72,7 @@ def begin(self):
"'NAME': '%s'" % DB_NAME)
new_st = new_st.replace("SECRET_KEY = ''",
"SECRET_KEY = 'testinglolz'")
- new_st = new_st + "\nINSTALLED_APPS = list(INSTALLED_APPS) + " \
+ new_st = new_st + "\nimport base\nINSTALLED_APPS = list(base.INSTALLED_APPS) + " \
"['django.contrib.admin']\n"
with open(st, 'w') as f:

0 comments on commit cb0ec40

Please sign in to comment.