def test_locate(self): self.assertEqual(pycode.locate('dir'), dir) self.assertEqual(pycode.locate('object'), object) self.assertEqual(type(pycode.locate('os')), types.ModuleType) self.assertEqual(type(pycode.locate('pycode')), types.ModuleType) self.assertEqual(type(pycode.locate('pycode.struct_code')), types.FunctionType)
def test_struct_module_pycode(self): pycode_module = pycode.locate('pycode') code = pycode.PyCodeStruct() struct_pycode = code.struct(pycode_module)
def test_struct_module_os(self): os_module = pycode.locate('os') code = pycode.PyCodeStruct() struct_os = code.struct(os_module) self.assertEqual(struct_os['doc_location'], 'http://docs.python.org/library/os')