~ubuntu-branches/ubuntu/natty/python3.1/natty-security

« back to all changes in this revision

Viewing changes to Lib/distutils/tests/test_cygwinccompiler.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-11-28 10:22:35 UTC
  • mfrom: (1.4.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20101128102235-x4dwl53601yn1orc
Tags: 3.1.3-1
* Python 3.1.3 release.
  - Issue #10391: Don't dereference invalid memory in error messages
    in the ast module.
  - Issue #10459: Update CJK character names to Unicode 5.1.
  - Issue #10092: Properly reset locale in calendar.Locale*Calendar classes.
  - Issue #6098: Don't claim DOM level 3 conformance in minidom.
  - Issue #5762: Fix AttributeError raised by ``xml.dom.minidom`` when
    an empty XML namespace attribute is encountered.
  - Issue #1710703: Write structures for an empty ZIP archive when a ZipFile
    is created in modes 'a' or 'w' and then closed without adding any files.
    Raise BadZipfile (rather than IOError) when opening small non-ZIP files.
  - Issue #4493: urllib.request adds '/' in front of path components which
    does not start with '/. Common behavior exhibited by browsers and other
    clients.
  - Issue #6378: idle.bat now runs with the appropriate Python version
    rather than the system default. Patch by Sridhar Ratnakumar.
  - Issue #10407: Fix two NameErrors in distutils.
  - Issue #10198: fix duplicate header written to wave files when
    writeframes() is called without data.
  - Issue #10467: Fix BytesIO.readinto() after seeking into a position after
    the end of the file.
  - Issue #1682942: configparser supports alternative option/value delimiters.
  - Backport r83399 to allow test_distutils to pass on installed versions.
  - Accept Oracle Berkeley DB 4.8, 5.0 and 5.1 as backend for the dbm
    extension.
  - Issue #10299: List the built-in functions in a table in functions.rst.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        sys.version = ('2.6.1 (r261:67515, Dec  6 2008, 16:42:21) \n[GCC '
66
66
                       '4.0.1 (Apple Computer, Inc. build 5370)]')
67
67
 
68
 
        self.assertEquals(check_config_h()[0], CONFIG_H_OK)
 
68
        self.assertEqual(check_config_h()[0], CONFIG_H_OK)
69
69
 
70
70
        # then it tries to see if it can find "__GNUC__" in pyconfig.h
71
71
        sys.version = 'something without the *CC word'
72
72
 
73
73
        # if the file doesn't exist it returns  CONFIG_H_UNCERTAIN
74
 
        self.assertEquals(check_config_h()[0], CONFIG_H_UNCERTAIN)
 
74
        self.assertEqual(check_config_h()[0], CONFIG_H_UNCERTAIN)
75
75
 
76
76
        # if it exists but does not contain __GNUC__, it returns CONFIG_H_NOTOK
77
77
        self.write_file(self.python_h, 'xxx')
78
 
        self.assertEquals(check_config_h()[0], CONFIG_H_NOTOK)
 
78
        self.assertEqual(check_config_h()[0], CONFIG_H_NOTOK)
79
79
 
80
80
        # and CONFIG_H_OK if __GNUC__ is found
81
81
        self.write_file(self.python_h, 'xxx __GNUC__ xxx')
82
 
        self.assertEquals(check_config_h()[0], CONFIG_H_OK)
 
82
        self.assertEqual(check_config_h()[0], CONFIG_H_OK)
83
83
 
84
84
    def test_get_versions(self):
85
85
 
86
86
        # get_versions calls distutils.spawn.find_executable on
87
87
        # 'gcc', 'ld' and 'dllwrap'
88
 
        self.assertEquals(get_versions(), (None, None, None))
 
88
        self.assertEqual(get_versions(), (None, None, None))
89
89
 
90
90
        # Let's fake we have 'gcc' and it returns '3.4.5'
91
91
        self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF'
92
92
        res = get_versions()
93
 
        self.assertEquals(str(res[0]), '3.4.5')
 
93
        self.assertEqual(str(res[0]), '3.4.5')
94
94
 
95
95
        # and let's see what happens when the version
96
96
        # doesn't match the regular expression
97
97
        # (\d+\.\d+(\.\d+)*)
98
98
        self._exes['gcc'] = b'very strange output'
99
99
        res = get_versions()
100
 
        self.assertEquals(res[0], None)
 
100
        self.assertEqual(res[0], None)
101
101
 
102
102
        # same thing for ld
103
103
        self._exes['ld'] = b'GNU ld version 2.17.50 20060824'
104
104
        res = get_versions()
105
 
        self.assertEquals(str(res[1]), '2.17.50')
 
105
        self.assertEqual(str(res[1]), '2.17.50')
106
106
        self._exes['ld'] = b'@(#)PROGRAM:ld  PROJECT:ld64-77'
107
107
        res = get_versions()
108
 
        self.assertEquals(res[1], None)
 
108
        self.assertEqual(res[1], None)
109
109
 
110
110
        # and dllwrap
111
111
        self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF'
112
112
        res = get_versions()
113
 
        self.assertEquals(str(res[2]), '2.17.50')
 
113
        self.assertEqual(str(res[2]), '2.17.50')
114
114
        self._exes['dllwrap'] = b'Cheese Wrap'
115
115
        res = get_versions()
116
 
        self.assertEquals(res[2], None)
 
116
        self.assertEqual(res[2], None)
117
117
 
118
118
    def test_get_msvcr(self):
119
119
 
120
120
        # none
121
121
        sys.version  = ('2.6.1 (r261:67515, Dec  6 2008, 16:42:21) '
122
122
                        '\n[GCC 4.0.1 (Apple Computer, Inc. build 5370)]')
123
 
        self.assertEquals(get_msvcr(), None)
 
123
        self.assertEqual(get_msvcr(), None)
124
124
 
125
125
        # MSVC 7.0
126
126
        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
127
127
                       '[MSC v.1300 32 bits (Intel)]')
128
 
        self.assertEquals(get_msvcr(), ['msvcr70'])
 
128
        self.assertEqual(get_msvcr(), ['msvcr70'])
129
129
 
130
130
        # MSVC 7.1
131
131
        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
132
132
                       '[MSC v.1310 32 bits (Intel)]')
133
 
        self.assertEquals(get_msvcr(), ['msvcr71'])
 
133
        self.assertEqual(get_msvcr(), ['msvcr71'])
134
134
 
135
135
        # VS2005 / MSVC 8.0
136
136
        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
137
137
                       '[MSC v.1400 32 bits (Intel)]')
138
 
        self.assertEquals(get_msvcr(), ['msvcr80'])
 
138
        self.assertEqual(get_msvcr(), ['msvcr80'])
139
139
 
140
140
        # VS2008 / MSVC 9.0
141
141
        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
142
142
                       '[MSC v.1500 32 bits (Intel)]')
143
 
        self.assertEquals(get_msvcr(), ['msvcr90'])
 
143
        self.assertEqual(get_msvcr(), ['msvcr90'])
144
144
 
145
145
        # unknown
146
146
        sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '