'Test __getitem__ and __setitem__ calls'

def check_get_and_set_methods(self, tab):

    self.assertEquals(tab['type'], tab.type)
    self.assertEquals(tab['tab_id'], tab.tab_id)
    with self.assertRaises(KeyError):
        _ = tab['invalid_key']
    self.check_get_and_set_method_for_key(tab, 'name')
    self.check_get_and_set_method_for_key(tab, 'tab_id')
    with self.assertRaises(KeyError):
        tab['invalid_key'] = 'New    Value'
