~ubuntu-branches/ubuntu/saucy/python2.7/saucy-proposed

« back to all changes in this revision

Viewing changes to Lib/test/test_collections.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-05-15 19:15:16 UTC
  • mto: (36.1.23 sid)
  • mto: This revision was merged to the branch mainline in revision 87.
  • Revision ID: package-import@ubuntu.com-20130515191516-zmv6to904wemey7s
Tags: upstream-2.7.5
ImportĀ upstreamĀ versionĀ 2.7.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        self.assertRaises(TypeError, eval, 'Point(XXX=1, y=2)', locals())   # wrong keyword argument
79
79
        self.assertRaises(TypeError, eval, 'Point(x=1)', locals())          # missing keyword argument
80
80
        self.assertEqual(repr(p), 'Point(x=11, y=22)')
 
81
        self.assertNotIn('__dict__', dir(p))                              # verify instance has no dict
81
82
        self.assertNotIn('__weakref__', dir(p))
82
83
        self.assertEqual(p, Point._make([11, 22]))                          # test _make classmethod
83
84
        self.assertEqual(p._fields, ('x', 'y'))                             # test _fields attribute
84
85
        self.assertEqual(p._replace(x=1), (1, 22))                          # test _replace method
85
86
        self.assertEqual(p._asdict(), dict(x=11, y=22))                     # test _asdict method
86
 
        self.assertEqual(vars(p), p._asdict())                              # verify that vars() works
87
87
 
88
88
        try:
89
89
            p._replace(x=1, error=2)