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

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

Ensure that keys starting with _ are not displayed,
but the valuesa retrievable.

Definition at line 71 of file test_dictionary_grid.py.

00071                                            :
        """Ensure that keys starting with _ are not displayed,
        but the valuesa retrievable.

        """

        dicts = [{"key1_1": "val1_1", "key1_2": "val1_2", "__extra": ["boo","biz","baz"]},
                 {"key1_1": "val2_1", "key1_2": "val2_2", "__extra": self}]
        grid = DictionaryGrid(dicts)

        #make sure there are 2 columns
        self.assertEqual(len(grid.get_model()),2)

        #ensure that none of the columns are named _extra
        cols = grid.get_columns()
        for c in cols:
            self.assertEqual(c.get_title().startswith("key"), True)

        #select the first row
        selection = grid.get_selection()
        selection.select_path((0,))
        selected_dict = grid.selected_rows[0]
        self.assertEqual(selected_dict["__extra"],["boo","biz","baz"])

    def test_dicts_with_different_keys(self):


Generated by  Doxygen 1.6.0   Back to index