Logo Search packages:      
Sourcecode: quickly-widgets version File versions  Download package

def widgets::tests::test_dictionary_grid::TestDictionaryGrid::test_use_custom_columns (   self  ) 

Ensure that type hins work so inferred types can be
overridden and non-inferred type can be set.

Definition at line 152 of file test_dictionary_grid.py.

00152                                      :
        """Ensure that type hins work so inferred types can be
        overridden and non-inferred type can be set.

        """

        keys = ["id","price","bool?","foo"]
        hints = {"id":grid_column.StringColumn, "price":grid_column.IntegerColumn,
                 "bool?":grid_column.CurrencyColumn,"foo":grid_column.CheckColumn}
        dicts = [{"price":100,"id":"asdfas","bool?":10.01,"foo":True}]
        grid = DictionaryGrid(dicts, keys, hints)
        for c in grid.get_columns():
            key = c.key
            col_type = c.column_type
            if key == "id":
                self.assertEqual(col_type,gobject.TYPE_STRING)
            elif key == "price":
                self.assertEqual(col_type,gobject.TYPE_INT)
            elif key == "bool?":
                self.assertEqual(col_type,gobject.TYPE_FLOAT)
            elif key == "foo":
                self.assertEqual(col_type,gobject.TYPE_BOOLEAN)
            else:
                self.assertEqual("Extra key Found",False) 

    def test_infer_boolean_values(self):


Generated by  Doxygen 1.6.0   Back to index