Reverting the Revision: 77368. I committed Flox's big patch for tests by

mistake. ( It may come in for sure tough)
This commit is contained in:
Senthil Kumaran 2010-01-08 19:04:16 +00:00
parent 3ddc435af6
commit ce8e33a095
107 changed files with 436 additions and 794 deletions

View file

@ -2,7 +2,7 @@
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
from test.test_support import run_unittest
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
@ -13,8 +13,6 @@ ClassMethodType = type(classmethod(lambda c: None))
# This next line triggers an error on old versions of pyclbr.
# Silence Py3k warning
import_module('commands', deprecated=True)
from commands import getstatus
# Here we test the python class browser code.
@ -42,11 +40,11 @@ class PyclbrTest(TestCase):
def assertHaskey(self, obj, key, ignore):
''' succeed iff key in obj or key in ignore. '''
''' succeed iff obj.has_key(key) or key in ignore. '''
if key in ignore: return
if key not in obj:
print >>sys.stderr, "***", key
self.assertTrue(key in obj)
if not obj.has_key(key):
print >>sys.stderr, "***",key
self.assertTrue(obj.has_key(key))
def assertEqualsOrIgnored(self, a, b, ignore):
''' succeed iff a == b or a in ignore or b in ignore '''
@ -151,9 +149,7 @@ class PyclbrTest(TestCase):
def test_easy(self):
self.checkModule('pyclbr')
self.checkModule('doctest', ignore=("DocTestCase",))
# Silence Py3k warning
rfc822 = import_module('rfc822', deprecated=True)
self.checkModule('rfc822', rfc822)
self.checkModule('rfc822')
self.checkModule('difflib')
def test_decorators(self):