Beispiel #1
0
 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)))
Beispiel #2
0
 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
Beispiel #3
0
    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
Beispiel #4
0
 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)))