From e8c5fdba30dd391ba885063b62949f5bd356544b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 16 Feb 2012 19:32:17 +0100 Subject: Add test for packaging.util.set_platform (#13974). Patch by Tshepang Lekhonkhobe. --- Lib/packaging/tests/test_util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/packaging/tests/test_util.py b/Lib/packaging/tests/test_util.py index 737503e..7f7ed18 100644 --- a/Lib/packaging/tests/test_util.py +++ b/Lib/packaging/tests/test_util.py @@ -173,6 +173,11 @@ class UtilTestCase(support.EnvironRestorer, sys.stdout = self.old_stdout sys.stderr = self.old_stderr + def test_set_platform(self): + self.addCleanup(util.set_platform, util.get_platform()) + util.set_platform("fake") + self.assertEqual("fake", util.get_platform()) + def test_convert_path(self): # linux/mac os.sep = '/' -- cgit v0.12 From 2180ee641cbbc8c9d2318479907618b5c9cd6006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Fri, 17 Feb 2012 17:26:30 +0100 Subject: Fix code I unwittingly broke in b0e2d6592a1f (#14038) --- Lib/packaging/tests/support.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/packaging/tests/support.py b/Lib/packaging/tests/support.py index 06f06c9..d76d3db 100644 --- a/Lib/packaging/tests/support.py +++ b/Lib/packaging/tests/support.py @@ -342,7 +342,7 @@ def _get_xxmodule_path(): srcdir = sysconfig.get_config_var('projectbase') path = os.path.join(os.getcwd(), srcdir, 'Modules', 'xxmodule.c') else: - os.path.join(os.path.dirname(__file__), 'xxmodule.c') + path = os.path.join(os.path.dirname(__file__), 'xxmodule.c') if os.path.exists(path): return path -- cgit v0.12