test that object has a __dir__() implementation

This commit is contained in:
Benjamin Peterson 2011-05-25 09:33:37 -05:00
parent 04778a8150
commit dac9acedfd
1 changed files with 2 additions and 0 deletions

View File

@ -385,6 +385,8 @@ class BuiltinTest(unittest.TestCase):
except: except:
self.assertEqual(len(dir(sys.exc_info()[2])), 4) self.assertEqual(len(dir(sys.exc_info()[2])), 4)
# test that object has a __dir__()
self.assertEqual(sorted([].__dir__()), dir([]))
def test_divmod(self): def test_divmod(self):
self.assertEqual(divmod(12, 7), (1, 5)) self.assertEqual(divmod(12, 7), (1, 5))