from steward import Field, Component

import unittest


class A(Component):
    a = Field()


class B(A):
    b = Field()


class TestInheritance(unittest.TestCase):
    def test_class(self):
        self.assertEqual({'a'}, A._names_)

    def test_inherites(self):
        self.assertEqual({'a', 'b'}, B._names_)

    def test_simple(self):
        b = B(a=1, b=2)
        self.assertEqual(1, b.a)
        self.assertEqual(2, b.b)

@@ -425,8 +425,208 @@
 2, b.b)%0A
+%0A    def test_plain(self):%0A        b = B(a=1, b=2)%0A        self.assertEqual(%7B'a': 1, 'b': 2%7D, b.as_plain())%0A        c = B.from_plain(b.as_plain())%0A        self.assertEqual(b.as_plain(), c.as_plain())%0A

check for plain representation of inherited components