Exemplo n.º 1
0
 def test_get_language_name_method(self):
     """ Test if the ``get_language_name`` return the value set at constructor. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child('test', generate_fixed_code_block_type_cls('foobar'),
                                          attrs={}, content='# Hello World!')
     language_name = tree_node.get_language_name()
     self.assertEqual('foobar', language_name)
Exemplo n.º 2
0
 def test_custom_tag_name(self):
     """ Test the constructor with a custom tag name set. """
     cls = generate_fixed_code_block_type_cls('customtype',
                                              canonical_tag_name='foobar')
     self.assertEqual('customtype', cls.language_name)
     self.assertEqual('foobar', cls.canonical_tag_name)
     self.assertEqual((), cls.alias_tag_names)
Exemplo n.º 3
0
 def test_get_language_name_method(self):
     """ Test if the ``get_language_name`` return the value set at constructor. """
     root_tree_node = RootTreeNode()
     tree_node = root_tree_node.new_child(
         'test',
         generate_fixed_code_block_type_cls('foobar'),
         attrs={},
         content='# Hello World!')
     language_name = tree_node.get_language_name()
     self.assertEqual('foobar', language_name)
Exemplo n.º 4
0
 def test_custom_tag_name(self):
     """ Test the constructor with a custom tag name set. """
     cls = generate_fixed_code_block_type_cls('customtype', canonical_tag_name='foobar')
     self.assertEqual('customtype', cls.language_name)
     self.assertEqual('foobar', cls.canonical_tag_name)
     self.assertEqual((), cls.alias_tag_names)