diff options
| author | ?ric Araujo <merwok@netwok.org> | 2012-02-09 18:45:37 +0100 |
|---|---|---|
| committer | ?ric Araujo <merwok@netwok.org> | 2012-02-09 18:45:37 +0100 |
| commit | b826adf03b65157802aefe2ae67ac0e4c93efe10 (patch) | |
| tree | d77f4aee7352f62b32d85ea9ed22401c6a9ca0ea /distutils2/tests | |
| parent | 316e3b2d872c95212a4d25d733d76f5f2a3f7602 (diff) | |
| parent | f2fedca91208e0d36cebce428e8b2e26aa68c74c (diff) | |
| download | disutils2-b826adf03b65157802aefe2ae67ac0e4c93efe10.tar.gz | |
Branch merge
Diffstat (limited to 'distutils2/tests')
| -rw-r--r-- | distutils2/tests/test_markers.py | 10 | ||||
| -rw-r--r-- | distutils2/tests/test_run.py | 28 |
2 files changed, 31 insertions, 7 deletions
diff --git a/distutils2/tests/test_markers.py b/distutils2/tests/test_markers.py index 89697d0..be82a88 100644 --- a/distutils2/tests/test_markers.py +++ b/distutils2/tests/test_markers.py @@ -22,8 +22,6 @@ class MarkersTestCase(LoggingCatcher, self.assertTrue(interpret("sys.platform == '%s'" % sys_platform)) self.assertTrue(interpret( - "sys.platform == '%s' or python_version == '2.4'" % sys_platform)) - self.assertTrue(interpret( "sys.platform == '%s' and python_full_version == '%s'" % (sys_platform, version))) self.assertTrue(interpret("'%s' == sys.platform" % sys_platform)) @@ -42,12 +40,18 @@ class MarkersTestCase(LoggingCatcher, # combined operations OP = 'os.name == "%s"' % os_name + FALSEOP = 'os.name == "buuuu"' AND = ' and ' OR = ' or ' self.assertTrue(interpret(OP + AND + OP)) self.assertTrue(interpret(OP + AND + OP + AND + OP)) self.assertTrue(interpret(OP + OR + OP)) - self.assertTrue(interpret(OP + OR + OP + OR + OP)) + self.assertTrue(interpret(OP + OR + FALSEOP)) + self.assertTrue(interpret(OP + OR + OP + OR + FALSEOP)) + self.assertTrue(interpret(OP + OR + FALSEOP + OR + FALSEOP)) + self.assertTrue(interpret(FALSEOP + OR + OP)) + self.assertFalse(interpret(FALSEOP + AND + FALSEOP)) + self.assertFalse(interpret(FALSEOP + OR + FALSEOP)) # other operators self.assertTrue(interpret("os.name != 'buuuu'")) diff --git a/distutils2/tests/test_run.py b/distutils2/tests/test_run.py index 65a9051..64df17f 100644 --- a/distutils2/tests/test_run.py +++ b/distutils2/tests/test_run.py @@ -60,22 +60,42 @@ class RunTestCase(support.TempdirManager, os.chmod(install_path, old_mod) install.get_path = old_get_path - def test_show_help(self): - # smoke test, just makes sure some help is displayed + def get_pythonpath(self): pythonpath = os.environ.get('PYTHONPATH') d2parent = os.path.dirname(os.path.dirname(__file__)) if pythonpath is not None: - pythonpath = os.pathsep.join((pythonpath, d2parent)) + pythonpath = os.pathsep.join((pythonpath, d2parent)) else: pythonpath = d2parent + return pythonpath + def test_show_help(self): + # smoke test, just makes sure some help is displayed status, out, err = assert_python_ok( '-c', 'from distutils2.run import main; main()', '--help', - PYTHONPATH=pythonpath) + PYTHONPATH=self.get_pythonpath()) self.assertEqual(status, 0) self.assertGreater(out, '') self.assertEqual(err, '') + def test_list_commands(self): + status, out, err = assert_python_ok( + '-c', 'from distutils2.run import main; main()', 'run', + '--list-commands', PYTHONPATH=self.get_pythonpath()) + # check that something is displayed + self.assertEqual(status, 0) + self.assertGreater(out, '') + self.assertEqual(err, '') + + # make sure the manual grouping of commands is respected + check_position = out.find(' check: ') + build_position = out.find(' build: ') + self.assertTrue(check_position, out) # "out" printed as debugging aid + self.assertTrue(build_position, out) + self.assertLess(check_position, build_position, out) + + # TODO test that custom commands don't break --list-commands + def test_suite(): return unittest.makeSuite(RunTestCase) |
