diff options
author | Josh Gao <jmgao@google.com> | 2016-04-29 18:06:20 -0700 |
---|---|---|
committer | Josh Gao <jmgao@google.com> | 2016-04-29 18:18:37 -0700 |
commit | 039a04d8a5dda0ffad38364a9de21e66843db1a4 (patch) | |
tree | ae775a6a70c7c350fa9eeb9a9dd6c191ec041b9a /lib/python2.7/distutils/tests/test_config_cmd.py | |
parent | 0eac5d899bac5ad9180ff04f80cd2edb5ffa3f19 (diff) | |
download | linux-x86-039a04d8a5dda0ffad38364a9de21e66843db1a4.tar.gz |
Update gdb to 7.11.android-wear-n-preview-3android-wear-n-preview-2android-wear-n-preview-1android-wear-7.1.1_r1android-n-preview-5android-n-preview-4android-n-preview-3android-n-iot-preview-2nougat-mr1-wear-releasen-iot-preview-2
Taken from NDK build 2824841.
Bug: http://b/28244367
Change-Id: I61369cec1cf7da5b5f352e2c6b618887ab4d525c
Diffstat (limited to 'lib/python2.7/distutils/tests/test_config_cmd.py')
-rw-r--r-- | lib/python2.7/distutils/tests/test_config_cmd.py | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/lib/python2.7/distutils/tests/test_config_cmd.py b/lib/python2.7/distutils/tests/test_config_cmd.py deleted file mode 100644 index e16c8ee..0000000 --- a/lib/python2.7/distutils/tests/test_config_cmd.py +++ /dev/null @@ -1,91 +0,0 @@ -"""Tests for distutils.command.config.""" -import unittest -import os -import sys -from test.test_support import run_unittest - -from distutils.command.config import dump_file, config -from distutils.tests import support -from distutils import log - -class ConfigTestCase(support.LoggingSilencer, - support.TempdirManager, - unittest.TestCase): - - def _info(self, msg, *args): - for line in msg.splitlines(): - self._logs.append(line) - - def setUp(self): - super(ConfigTestCase, self).setUp() - self._logs = [] - self.old_log = log.info - log.info = self._info - - def tearDown(self): - log.info = self.old_log - super(ConfigTestCase, self).tearDown() - - def test_dump_file(self): - this_file = os.path.splitext(__file__)[0] + '.py' - f = open(this_file) - try: - numlines = len(f.readlines()) - finally: - f.close() - - dump_file(this_file, 'I am the header') - self.assertEqual(len(self._logs), numlines+1) - - def test_search_cpp(self): - # TODO: mingw host ? - if sys.platform == 'win32': - return - pkg_dir, dist = self.create_dist() - cmd = config(dist) - - # simple pattern searches - match = cmd.search_cpp(pattern='xxx', body='/* xxx */') - self.assertEqual(match, 0) - - match = cmd.search_cpp(pattern='_configtest', body='/* xxx */') - self.assertEqual(match, 1) - - def test_finalize_options(self): - # finalize_options does a bit of transformation - # on options - pkg_dir, dist = self.create_dist() - cmd = config(dist) - cmd.include_dirs = 'one%stwo' % os.pathsep - cmd.libraries = 'one' - cmd.library_dirs = 'three%sfour' % os.pathsep - cmd.ensure_finalized() - - self.assertEqual(cmd.include_dirs, ['one', 'two']) - self.assertEqual(cmd.libraries, ['one']) - self.assertEqual(cmd.library_dirs, ['three', 'four']) - - def test_clean(self): - # _clean removes files - tmp_dir = self.mkdtemp() - f1 = os.path.join(tmp_dir, 'one') - f2 = os.path.join(tmp_dir, 'two') - - self.write_file(f1, 'xxx') - self.write_file(f2, 'xxx') - - for f in (f1, f2): - self.assertTrue(os.path.exists(f)) - - pkg_dir, dist = self.create_dist() - cmd = config(dist) - cmd._clean(f1, f2) - - for f in (f1, f2): - self.assertTrue(not os.path.exists(f)) - -def test_suite(): - return unittest.makeSuite(ConfigTestCase) - -if __name__ == "__main__": - run_unittest(test_suite()) |