Exemplo n.º 1
0
class testModel(unittest.TestCase):
    def setUp(self):
        self.m = Model()
    def testGetattr(self):
        self.m.foo = 3
        self.assertEqual(self.m.getattr('foo'), 3)
    def testSetattr(self):
        self.m.setattr('bar', Ellipsis)
        self.assertEqual(self.m.bar, Ellipsis)
    def testError(self):
        self.assertRaises(AttributeError, self.m.getattr, 'NO.SUCH.ATTRIBUTE')
Exemplo n.º 2
0
class testModel(unittest.TestCase):
    def setUp(self):
        self.m = Model()

    def testGetattr(self):
        self.m.foo = 3
        self.assertEqual(self.m.getattr('foo'), 3)

    def testSetattr(self):
        self.m.setattr('bar', Ellipsis)
        self.assertEqual(self.m.bar, Ellipsis)

    def testError(self):
        self.assertRaises(AttributeError, self.m.getattr, 'NO.SUCH.ATTRIBUTE')
Exemplo n.º 3
0
 def setUp(self):
     self.m = Model()
Exemplo n.º 4
0
 def setUp(self):
     self.m = Model()