summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_structseq.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-07-08 22:33:03 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-07-08 22:33:03 (GMT)
commitd02441ea2fcf3862c92bf990ac568d8cb1e19d48 (patch)
treecd26ccb5750523e7ff232d1400c32fc07c05e225 /Lib/test/test_structseq.py
parent8c567c540ddabce2536b0f5907ff94408e8e4410 (diff)
downloadcpython-d02441ea2fcf3862c92bf990ac568d8cb1e19d48.zip
cpython-d02441ea2fcf3862c92bf990ac568d8cb1e19d48.tar.gz
cpython-d02441ea2fcf3862c92bf990ac568d8cb1e19d48.tar.bz2
fix repr of complicated structseqs #9206
Diffstat (limited to 'Lib/test/test_structseq.py')
-rw-r--r--Lib/test/test_structseq.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_structseq.py b/Lib/test/test_structseq.py
index f01bc44..387a89c 100644
--- a/Lib/test/test_structseq.py
+++ b/Lib/test/test_structseq.py
@@ -1,7 +1,8 @@
+import os
+import time
import unittest
from test import support
-import time
class StructSeqTest(unittest.TestCase):
@@ -34,6 +35,13 @@ class StructSeqTest(unittest.TestCase):
self.assertEqual(repr(t),
"time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, "
"tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)")
+ # os.stat() gives a complicated struct sequence.
+ st = os.stat(__file__)
+ rep = repr(st)
+ self.assertTrue(rep.startswith("posix.stat_result"))
+ self.assertIn("st_mode=", rep)
+ self.assertIn("st_ino=", rep)
+ self.assertIn("st_dev=", rep)
def test_concat(self):
t1 = time.gmtime()