'Test basic functionality of stuff defined in an extension module'

def test_functionality(self):

    with util.uncache(self.name):
        module = self.load_module()
        self.assertIsInstance(module, types.ModuleType)
        ex = module.Example()
        self.assertEqual(ex.demo('abcd'), 'abcd')
        self.assertEqual(ex.demo(), None)
        with self.assertRaises(AttributeError):
            ex.abc
        ex.abc = 0
        self.assertEqual(ex.abc, 0)
        self.assertEqual(module.foo(9, 9), 18)
        self.assertIsInstance(module.Str(), str)
        self.assertEqual((module.Str(1) + '23'), '123')
        with self.assertRaises(module.error):
            raise module.error()
        self.assertEqual(module.int_const, 1969)
        self.assertEqual(module.str_const, 'something    different')
