def testIdAndClassExpansion(self): """Tests the ability to expand an id into an id and classes.""" tag_id = default.CSS_IDS.keys()[0] expected_string = 'id="%s" class="%s"' % (tag_id, default.CSS_IDS[tag_id]) self.assertEqual( get_id_and_classes(tag_id), expected_string, "Expected: %s but got %s." % (expected_string, get_id_and_classes(tag_id)))
def testDisabledIdExpansion(self): """Tests the ability to expand an id into an id and classes.""" saved_setting = default.RETURN_CLASSES default.RETURN_CLASSES = False tag_id = default.CSS_IDS.keys()[0] expected_string = 'id="%s"' % (tag_id,) self.assertEqual(get_id_and_classes(tag_id), expected_string, "Expected: %s but got %s." % (expected_string, get_id_and_classes(tag_id))) # Restore setting default.RETURN_CLASSES = saved_setting
def testDisabledIdExpansion(self): """Tests the ability to expand an id into an id and classes.""" saved_setting = default.RETURN_CLASSES default.RETURN_CLASSES = False tag_id = default.CSS_IDS.keys()[0] expected_string = 'id="%s"' % (tag_id, ) self.assertEqual( get_id_and_classes(tag_id), expected_string, "Expected: %s but got %s." % (expected_string, get_id_and_classes(tag_id))) # Restore setting default.RETURN_CLASSES = saved_setting
def testIdAndClassExpansion(self): """Tests the ability to expand an id into an id and classes.""" tag_id = default.CSS_IDS.keys()[0] expected_string = 'id="%s" class="%s"' % (tag_id, default.CSS_IDS[tag_id]) self.assertEqual(get_id_and_classes(tag_id), expected_string, "Expected: %s but got %s." % (expected_string, get_id_and_classes(tag_id)))