From 7b5f69de3f7b52b718507fe16c2560901e48a70c Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 6 Aug 2013 15:39:13 -0700 Subject: Refactor checks and vars --- attoconf/tests/test_core.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'attoconf/tests/test_core.py') diff --git a/attoconf/tests/test_core.py b/attoconf/tests/test_core.py index c10e8c7..fbbe622 100644 --- a/attoconf/tests/test_core.py +++ b/attoconf/tests/test_core.py @@ -20,7 +20,7 @@ from __future__ import print_function, division, absolute_import import unittest from attoconf.core import Project, Build -from attoconf.types import uint, shell_word +from attoconf.types import uint, shell_word, shell_partial_word from cStringIO import StringIO import sys @@ -95,14 +95,14 @@ General: self.assertEquals(build.relative_source(), '../foo') def test_configure(self): - def check_foo(bld, foo): - self.assertEqual(foo, 'B') - def check_bar(bld, bar): - self.assertEqual(bar, 1) - def check_qux(bld, qux): - self.assertEqual(qux, None) - def check_var(bld, var): - self.assertEqual(var, 'value') + def check_foo(bld, FOO): + self.assertEqual(FOO, 'B') + def check_bar(bld, BAR): + self.assertEqual(BAR, 1) + def check_qux(bld, QUX): + self.assertEqual(QUX, None) + def check_var(bld, VAR): + self.assertEqual(VAR, 'value') proj = Project('.') proj.add_alias('--alias', ['--foo=A', '--bar=1', '--foo=B'], @@ -117,7 +117,7 @@ General: type=uint, check=check_qux, help='help for int qux', hidden=False) proj.add_option('VAR', init='', - type=shell_word, check=check_var, + type=shell_partial_word, check=check_var, help='help for string VAR', hidden=False) build = Build(proj, '.') -- cgit v1.2.3-70-g09d2