예제 #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"])