Skip to content
Browse files

Fix and add tests.

  • Loading branch information...
1 parent 391de09 commit dd809ba51d9c07cedd8795359a1464a042bbef24 @fschulze fschulze committed Feb 6, 2010
Showing with 11 additions and 3 deletions.
  1. +3 −1 src/mr/developer/common.py
  2. +1 −1 src/mr/developer/extension.py
  3. +7 −1 src/mr/developer/tests/test_common.py
View
4 src/mr/developer/common.py
@@ -123,7 +123,9 @@ def worker():
def checkout(self, packages, **kwargs):
queue = Queue.Queue()
if 'update' in kwargs:
- if kwargs['update'].lower() in ('true', 'yes', 'on', 'force'):
+ if isinstance(kwargs['update'], bool):
+ pass
+ elif kwargs['update'].lower() in ('true', 'yes', 'on', 'force'):
if kwargs['update'].lower() == 'force':
kwargs['force'] = True
kwargs['update'] = True
View
2 src/mr/developer/extension.py
@@ -194,7 +194,7 @@ def __call__(self):
if pkg in sources:
packages.add(pkg)
- offline = self.buildout['buildout']['offline'].lower() == 'true'
+ offline = self.buildout['buildout'].get('offline', '').lower() == 'true'
workingcopies.checkout(sorted(packages),
verbose=root_logger.level <= 10,
update=always_checkout,
View
8 src/mr/developer/tests/test_common.py
@@ -11,5 +11,11 @@ def checkOptions(self, options):
self.assertEquals(len(option), 3)
def testTimeoutValue(self):
- options, settings = self.parse_buildout_args(['-t', '5'])
+ options, settings, args = self.parse_buildout_args(['-t', '5'])
self.checkOptions(options)
+
+ def testCommands(self):
+ options, settings, args = self.parse_buildout_args(['-t', '5'])
+ self.assertEquals(len(args), 0)
+ options, settings, args = self.parse_buildout_args(['-t', '5', 'install', 'partname'])
+ self.assertEquals(len(args), 2)

0 comments on commit dd809ba

Please sign in to comment.
Something went wrong with that request. Please try again.