示例#1
0
文件: test_cwrap.py 项目: akva2/ert
    def test_class_variables(self):
        BaseCClass.cNamespace().hello = "BooYa!"
        StringListTest.cNamespace()["pow"] = "Badonkadonk!"

        with self.assertRaises(AssertionError):
            StringListTest.cNamespace().pow = "Badonkadonka!"

        with self.assertRaises(LookupError):
            self.assertFalse(BaseCClass.cNamespace()["pow"])

        with self.assertRaises(AttributeError):
            self.assertFalse(StringListTest.cNamespace().hello)

        self.assertEqual(StringListTest.cNamespace().pow, StringListTest.cNamespace()["pow"])
示例#2
0
    def test_class_variables(self):
        BaseCClass.cNamespace().hello = "BooYa!"
        StringListTest.cNamespace()["pow"] = "Badonkadonk!"

        with self.assertRaises(AssertionError):
            StringListTest.cNamespace().pow = "Badonkadonka!"

        with self.assertRaises(LookupError):
            self.assertFalse(BaseCClass.cNamespace()["pow"])

        with self.assertRaises(AttributeError):
            self.assertFalse(StringListTest.cNamespace().hello)

        self.assertEqual(StringListTest.cNamespace().pow,
                         StringListTest.cNamespace()["pow"])