def test_filter_keys(self): """Tests the utils.filter_keys function""" self.assertEqual( {'a': 1, 'b': 2}, utils.filter_keys({'a': 1, 'b': 2, 'c': 3}, 'a', 'b') ) self.assertEqual( {}, utils.filter_keys({'a': 1, 'b': 2, 'c': 3}, 'd', 'e') )
def from_json(d): return Column( **from_json( filter_keys( d, 'name', 'tablename', 'type', 'nullable', 'default', 'autoincrement', 'primary_key', 'autocomplete' ) ) )
def from_json(d): return Table( **from_json( filter_keys( d, 'name', 'uri', 'owner', 'size', 'primary_key', 'columns', 'foreign_keys', 'autocomplete' ) ) )
def from_json(d): return Row( **from_json(filter_keys(d, 'table', 'row', 'autocomplete')) )
def from_json(d): return Row(**from_json(filter_keys(d, 'table', 'row', 'autocomplete')))
def from_json(d): return Table(**from_json( filter_keys(d, 'name', 'uri', 'owner', 'size', 'primary_key', 'columns', 'foreign_keys', 'autocomplete')))