示例#1
0
class TestBaseObjectListStore(unittest.TestCase):
    def setUp(self):
        self.store = BaseObjectListStore(_DummyObject)

    def tearDown(self):
        del self.store

    def test_setup(self):
        self.assertNotEqual(self.store, None)

    def test_columns(self):
        self.assertEqual(
            self.store.get_n_columns(),
            len(self.store._class_type.Meta.get_column_properties()))
        self.assertEqual(self.store.get_column_type(self.store.c_name),
                         GObject.type_from_name("gchararray"))
        self.assertEqual(self.store.get_column_type(self.store.c_number),
                         GObject.type_from_name("gdouble"))
        self.assertEqual(self.store.get_column_type(self.store.c_test),
                         GObject.type_from_name("PyObject"))

    def test_convert(self):
        self.assertEqual(self.store.convert(1, "0.5"), 0.5)

    pass  # end of class
示例#2
0
 def setUp(self):
     self.store = BaseObjectListStore(_DummyObject)