diff options
author | Greg Noel <GregNoel@tigris.org> | 2010-04-26 18:49:06 (GMT) |
---|---|---|
committer | Greg Noel <GregNoel@tigris.org> | 2010-04-26 18:49:06 (GMT) |
commit | 28b036c0f803c2a156de7e155daa0f8635e95d89 (patch) | |
tree | f4c4ceb24a3fe3001dc394e833731ebdfbcca208 /src/engine | |
parent | 186b632fd20283e821b6a65c72772635017945fb (diff) | |
download | SCons-28b036c0f803c2a156de7e155daa0f8635e95d89.zip SCons-28b036c0f803c2a156de7e155daa0f8635e95d89.tar.gz SCons-28b036c0f803c2a156de7e155daa0f8635e95d89.tar.bz2 |
http://scons.tigris.org/issues/show_bug.cgi?id=2345
Apply all the remaining changes from the fixers.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/DefaultsTests.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/SubstTests.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/UtilTests.py | 52 |
3 files changed, 20 insertions, 36 deletions
diff --git a/src/engine/SCons/DefaultsTests.py b/src/engine/SCons/DefaultsTests.py index 96d5de7..fd10c12 100644 --- a/src/engine/SCons/DefaultsTests.py +++ b/src/engine/SCons/DefaultsTests.py @@ -26,8 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.compat import os -import os.path -import StringIO import sys import unittest diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index fbd5037..1c8412c 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -26,8 +26,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.compat import os -import os.path -import StringIO import sys import unittest diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py index a4d69d7..2d7f3fa 100644 --- a/src/engine/SCons/UtilTests.py +++ b/src/engine/SCons/UtilTests.py @@ -25,12 +25,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import SCons.compat -import collections import io import os import sys import unittest - +from collections import UserDict, UserList, UserString import TestCmd @@ -38,7 +37,7 @@ import SCons.Errors from SCons.Util import * -try: unicode +try: eval('unicode') except NameError: HasUnicode = False else: HasUnicode = True @@ -207,7 +206,7 @@ class UtilTestCase(unittest.TestCase): def test_is_Dict(self): assert is_Dict({}) - assert is_Dict(collections.UserDict()) + assert is_Dict(UserDict()) try: class mydict(dict): pass @@ -223,8 +222,7 @@ class UtilTestCase(unittest.TestCase): def test_is_List(self): assert is_List([]) - import UserList - assert is_List(collections.UserList()) + assert is_List(UserList()) try: class mylist(list): pass @@ -242,12 +240,7 @@ class UtilTestCase(unittest.TestCase): assert is_String("") if HasUnicode: exec "assert is_String(u'')" - try: - import UserString - except: - pass - else: - assert is_String(collections.UserString('')) + assert is_String(UserString('')) try: class mystr(str): pass @@ -280,27 +273,22 @@ class UtilTestCase(unittest.TestCase): assert to_String([ 1, 2, 3]) == str([1, 2, 3]), to_String([1,2,3]) assert to_String("foo") == "foo", to_String("foo") - try: - import UserString + s1=UserString('blah') + assert to_String(s1) == s1, s1 + assert to_String(s1) == 'blah', s1 - s1=collections.UserString('blah') - assert to_String(s1) == s1, s1 - assert to_String(s1) == 'blah', s1 - - class Derived(collections.UserString): - pass - s2 = Derived('foo') - assert to_String(s2) == s2, s2 - assert to_String(s2) == 'foo', s2 - - if HasUnicode: - s3=collections.UserString(unicode('bar')) - assert to_String(s3) == s3, s3 - assert to_String(s3) == unicode('bar'), s3 - assert isinstance(to_String(s3), unicode), \ - type(to_String(s3)) - except ImportError: + class Derived(UserString): pass + s2 = Derived('foo') + assert to_String(s2) == s2, s2 + assert to_String(s2) == 'foo', s2 + + if HasUnicode: + s3=UserString(unicode('bar')) + assert to_String(s3) == s3, s3 + assert to_String(s3) == unicode('bar'), s3 + assert isinstance(to_String(s3), unicode), \ + type(to_String(s3)) if HasUnicode: s4 = unicode('baz') @@ -618,7 +606,7 @@ class UtilTestCase(unittest.TestCase): s['c'] = 'CCC' assert s['c'] == 'CCC', s['c'] - class DummyEnv(collections.UserDict): + class DummyEnv(UserDict): def subst(self, key): if key[0] == '$': return self[key[1:]] |