<s> import unittest <EOL> from flask import Flask <EOL> from flask_json import json_response , FlaskJSON , JsonTestResponse <EOL> def our_app ( ) : <EOL> app = Flask ( __name__ ) <EOL> app . test_value = <NUM_LIT:0> <EOL> FlaskJSON ( app ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def increment ( ) : <EOL> app . test_value += <NUM_LIT:1> <EOL> return json_response ( value = app . test_value ) <EOL> return app <EOL> class OurAppTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . app = our_app ( ) <EOL> self . app . config [ '<STR_LIT>' ] = True <EOL> self . app . response_class = JsonTestResponse <EOL> self . client = self . app . test_client ( ) <EOL> def test_app ( self ) : <EOL> r = self . client . get ( '<STR_LIT>' ) <EOL> assert '<STR_LIT:value>' in r . json <EOL> assert r . json [ '<STR_LIT:value>' ] == <NUM_LIT:1> <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
