'Helper method to verify a tab class.
\'tab_class\' is the class of the tab that is being tested
\'dict_tab\' is the raw dictionary value of the tab
\'expected_link\' is the expected value for the hyperlink of the tab
\'expected_tab_id\' is the expected value for the unique id of the tab
\'expected_name\' is the expected value for the name of the tab
\'invalid_dict_tab\' is an invalid dictionary value for the tab.
Can be \'None\' if the given tab class does not have any keys to validate.'

def check_tab(self, tab_class, dict_tab, expected_link, expected_tab_id, expected_name='same', invalid_dict_tab=None):

    tab = tab_class(tab_dict=dict_tab)
    self.assertEqual(tab.name, expected_name)
    self.assertEqual(tab.link_func(self.course, self.reverse), expected_link)
    self.assertEqual(tab.tab_id, expected_tab_id)
    self.assertTrue(tab.validate(dict_tab))
    if invalid_dict_tab:
        with self.assertRaises(xmodule_tabs.InvalidTabsException):
            tab.validate(invalid_dict_tab)
    self.check_get_and_set_methods(tab)
    self.check_tab_json_methods(tab)
    self.check_tab_equality(tab, dict_tab)
    return tab
