Lines Matching full:foo
23 foo = ModuleType.__new__(ModuleType)
24 self.assertTrue(foo.__dict__ is None)
25 self.assertRaises(SystemError, dir, foo)
27 s = foo.__name__
31 self.assertEqual(foo.__doc__, ModuleType.__doc__)
36 foo = ModuleType.__new__(ModuleType)
39 getattr, foo, "not_here")
44 foo = ModuleType("foo")
46 AttributeError, "module 'foo' has no attribute 'not_here'",
47 getattr, foo, "not_here")
51 foo = ModuleType("foo")
52 self.assertEqual(foo.__name__, "foo")
53 self.assertEqual(foo.__doc__, None)
54 self.assertIs(foo.__loader__, None)
55 self.assertIs(foo.__package__, None)
56 self.assertIs(foo.__spec__, None)
57 self.assertEqual(foo.__dict__, {"__name__": "foo", "__doc__": None,
63 foo = ModuleType("foo", "foodoc")
64 self.assertEqual(foo.__name__, "foo")
65 self.assertEqual(foo.__doc__, "foodoc")
66 self.assertEqual(foo.__dict__,
67 {"__name__": "foo", "__doc__": "foodoc",
73 foo = ModuleType("foo", "foodoc\u1234")
74 self.assertEqual(foo.__name__, "foo")
75 self.assertEqual(foo.__doc__, "foodoc\u1234")
76 self.assertEqual(foo.__dict__,
77 {"__name__": "foo", "__doc__": "foodoc\u1234",
83 foo = ModuleType("foo", "foodoc\u1234")
84 foo.bar = 42
85 d = foo.__dict__
86 foo.__init__("foo", "foodoc")
87 self.assertEqual(foo.__name__, "foo")
88 self.assertEqual(foo.__doc__, "foodoc")
89 self.assertEqual(foo.bar, 42)
90 self.assertEqual(foo.__dict__,
91 {"__name__": "foo", "__doc__": "foodoc", "bar": 42,
93 self.assertTrue(foo.__dict__ is d)
98 foo = ModuleType("foo")
99 foo.bar = 4
100 return foo
107 m = ModuleType("foo")
121 m = ModuleType("foo")
181 m = ModuleType('foo')
186 m = ModuleType('foo')
187 self.assertEqual(repr(m), "<module 'foo'>")
190 m = ModuleType('foo')
191 m.__file__ = '/tmp/foo.py'
192 self.assertEqual(repr(m), "<module 'foo' from '/tmp/foo.py'>")
195 m = ModuleType('foo')
197 m.__file__ = '/tmp/foo.py'
198 self.assertEqual(repr(m), "<module '?' from '/tmp/foo.py'>")
201 m = ModuleType('foo')
203 self.assertEqual(repr(m), "<module 'foo'>")
206 m = ModuleType('foo')
218 m = ModuleType('foo')
227 m = ModuleType('foo')
232 repr(m), "<module 'foo' ({})>".format(module_repr))
235 m = ModuleType('foo')
239 repr(m), "<module 'foo' (crafted)>")
243 m = ModuleType('foo')
246 m.__file__ = '/tmp/foo.py'
247 self.assertEqual(repr(m), "<module 'foo' from '/tmp/foo.py'>")
251 m = ModuleType('foo')
254 m.__file__ = '/tmp/foo.py'
255 self.assertEqual(repr(m), "<module 'foo' (crafted)>")