def test_class_level_appears_before_method_level_annotations( self, method_handler_builder): method_level1 = decorators.MethodAnnotation() method_level2 = decorators.MethodAnnotation() class_level1 = decorators.MethodAnnotation() class_level2 = decorators.MethodAnnotation() method_handler_builder.add_annotation(method_level1) method_handler_builder.add_annotation(method_level2) method_handler_builder.add_annotation(class_level1, is_class=True) method_handler_builder.add_annotation(class_level2, is_class=True) handler = method_handler_builder.build() assert list(handler.annotations) == [ class_level1, class_level2, method_level1, method_level2, ]
def method_annotation(): return decorators.MethodAnnotation()