<s> import unittest <EOL> import flask <EOL> from flask import Flask , request <EOL> from flask_reggie import Reggie <EOL> def create_app ( ) : <EOL> if "<STR_LIT>" in flask . __version__ : <EOL> return Flask ( '<STR_LIT>' ) <EOL> return Flask ( '<STR_LIT>' ) <EOL> class FlaskReggieTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> self . app = create_app ( ) <EOL> reggie = Reggie ( ) <EOL> reggie . init_app ( self . app ) <EOL> @ self . app . route ( '<STR_LIT>' ) <EOL> def index ( test ) : <EOL> return "<STR_LIT>" <EOL> self . client = self . app . test_client ( ) <EOL> def test_valid_pattern ( self ) : <EOL> with self . app . test_client ( ) as c : <EOL> rv = c . get ( '<STR_LIT>' ) <EOL> assert rv . data == "<STR_LIT>" <EOL> assert request . view_args [ '<STR_LIT:test>' ] == "<STR_LIT>" <EOL> def test_invalid_pattern ( self ) : <EOL> with self . app . test_client ( ) as c : <EOL> rv = c . get ( '<STR_LIT>' ) <EOL> assert rv . status_code == <NUM_LIT> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
