Skip to content

Commit

Permalink
name cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
shimon committed Apr 8, 2011
1 parent c6f40e6 commit 031cbde
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions dz/tasklib/tests/unittests/test_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import logging
from StringIO import StringIO

from mocker import ANY, MATCH
# from mocker import ANY, MATCH

from boto.s3.connection import S3Connection
from os import path
Expand Down Expand Up @@ -174,19 +174,23 @@ def test_build_bundle(self):
taskconfig.DZ_ADMIN_MEDIA["url_path"]) in lines)

# ensure we've predefined and redefined our settings
MR_line = ("MEDIA_ROOT = os.environ['CONFIG_WRITABLE_ROOT'] "
"+ '/static'")
settings_override_line = "DATABASE_ENGINE = 'postgresql_psycopg2'"
import_line = "from mysite.settings import *"

# check that things are in there before we try to check their
# ordering
self.assertTrue(settings_override_line in lines, lines)
self.assertTrue(import_line in lines, lines)

try:
first_MR = lines.index(MR_line)
first_import = lines.index("from mysite.settings import *",
first_MR)
last_MR = lines.index(MR_line, first_import)
first_settings = lines.index(settings_override_line)
first_import = lines.index(import_line, first_settings)
last_settings = lines.index(settings_override_line, first_import)
except ValueError:
print "Couldn't find something I expected in dz_settings."
raise

self.assertTrue(first_MR < first_import < last_MR)
self.assertTrue(first_settings < first_import < last_settings)



Expand Down

0 comments on commit 031cbde

Please sign in to comment.