

@patch.object(APIBlueprint, 'add_url_rule')
def test_add_url_rule(self, add_url_rule):
    '\n        Verify that add_url_rule is called with the right arguments when a route is\n        inherited and then overloaded.\n        '
    (bp, foo, bar) = self._setup_parent_blueprint()
    inherited_bp = APIBlueprint('bp_v2', __name__, url_prefix='/v2', inherit_from=bp)

    @inherited_bp.route('/bar')
    def overloaded_bar():
        return 'Overloaded bar'
    expected_calls = [call('/foo', 'foo', foo), call('/bar', 'bar', bar), call('/bar', 'overloaded_bar', overloaded_bar)]
    self.assertEqual(expected_calls, add_url_rule.call_args_list)

dataset/ETHPy150Open gwongz/flask-apiblueprint/test_apiblueprint.py TestAPIBlueprint.test_add_url_rule/original