def test_get_alert_type_method(self): """ Test the ``get_alert_type`` method. """ cls = generate_fixed_alert_type_cls('customtype') root_tree_node = RootTreeNode() tree_node = root_tree_node.new_child('alert', cls, attrs={}) alert_type = tree_node.get_alert_type() self.assertEqual('customtype', alert_type)
def test_custom_tag_name(self): """ Test the constructor with a custom tag name set. """ cls = generate_fixed_alert_type_cls('customtype', canonical_tag_name='foobar') self.assertEqual('customtype', cls.alert_type) self.assertEqual('foobar', cls.canonical_tag_name) self.assertEqual((), cls.alias_tag_names)