def setUp(self): """Create test data.""" self.table = 'people' self.db_file = create_db(self.table) self.datasource = SQLiteDataSource( self.db_file, table=self.table, config=[ { 'column': 'First name', 'type': 'str' }, { 'column': 'Last name', 'type': 'str' }, { 'column': 'Age', 'type': 'int' }, { 'column': 'Start', 'type': 'int', 'encoding': 'timestamp' }, { 'column': 'Image', 'type': 'int', 'encoding': 'image' }, ], ) self.datasource.MAX_RECS = 2
def setUp(self): # noqa """Create test data.""" self.table = 'people' self.db_file = create_db(self.table) self.datasource = SQLiteDataSource(self.db_file, self.table, None, [ { 'column': 'First name', 'type': 'str' }, { 'column': 'Last name', 'type': 'str' }, { 'column': 'Age', 'type': 'int' }, { 'column': 'Start', 'type': 'int', 'encoding': 'timestamp' }, { 'column': 'Image', 'type': 'buffer', 'encoding': 'image' }, ]) self.datasource.MAX_RECS = 2 # 2 records per page win = mock.MagicMock() datagrid_container = DataGridContainer(win) self.datagrid_controller = DataGridController(datagrid_container, self.datasource) self.model = self.datagrid_controller.model
def setUp(self): # noqa """Create test data.""" self.table = 'files' self.db_file = create_db(self.table) self.datasource = _FilesDataSource( self.db_file, self.table, None, [ { 'column': 'Parent', 'type': 'str' }, { 'column': 'Filename', 'type': 'str' }, { 'column': 'Flatname', 'type': 'str' }, { 'column': 'CHildren', 'type': 'int' }, ], ensure_selected_column=False, ) self.model = DataGridModel(self.datasource, None, None) self.model.active_params['order_by'] = '__id' self.model.refresh()
def setUp(self): """Create test data.""" self.table = 'people' self.db_file = create_db(self.table) self.datasource = SQLiteDataSource( self.db_file, table=self.table, config=[ {'column': 'First name', 'type': 'str'}, {'column': 'Last name', 'type': 'str'}, {'column': 'Age', 'type': 'int'}, {'column': 'Start', 'type': 'int', 'encoding': 'timestamp'}, {'column': 'Image', 'type': 'int', 'encoding': 'image'}, ], ) self.datasource.MAX_RECS = 2
def setUp(self): # noqa """Create test data.""" self.table = 'files' self.db_file = create_db(self.table) self.datasource = _FilesDataSource( self.db_file, self.table, None, [ {'column': 'Parent', 'type': 'str'}, {'column': 'Filename', 'type': 'str'}, {'column': 'Flatname', 'type': 'str'}, {'column': 'CHildren', 'type': 'int'}, ], ensure_selected_column=False, ) self.model = DataGridModel(self.datasource, None, None) self.model.active_params['order_by'] = '__id' self.model.refresh()
def setUp(self): # noqa """Create test data.""" self.table = 'people' self.db_file = create_db(self.table) self.datasource = SQLiteDataSource( self.db_file, self.table, None, [ {'column': 'First name', 'type': 'str'}, {'column': 'Last name', 'type': 'str'}, {'column': 'Age', 'type': 'int'}, {'column': 'Start', 'type': 'int', 'encoding': 'timestamp'}, {'column': 'Image', 'type': 'buffer', 'encoding': 'image'}, ] ) self.datasource.MAX_RECS = 2 # 2 records per page win = mock.MagicMock() datagrid_container = DataGridContainer(win) self.datagrid_controller = DataGridController( datagrid_container, self.datasource) self.model = self.datagrid_controller.model