<s> """<STR_LIT>""" <EOL> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from flask import Flask <EOL> from flask_pusher import Pusher <EOL> class FlaskPusherTest ( unittest . TestCase ) : <EOL> configs = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:abc>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:20> <EOL> } <EOL> def setUp ( self ) : <EOL> self . app = Flask ( __name__ ) <EOL> self . app . config . update ( self . configs ) <EOL> def test_init_no_app ( self ) : <EOL> pusher = Pusher ( ) <EOL> self . assertRaises ( AttributeError , lambda : getattr ( pusher , '<STR_LIT>' ) ) <EOL> def test_init ( self ) : <EOL> pusher = Pusher ( self . app ) <EOL> self . _assert_init ( pusher ) <EOL> def test_json_encoder ( self ) : <EOL> pusher = Pusher ( self . app ) <EOL> self . assertEqual ( pusher . _json_encoder , self . app . json_encoder ) <EOL> def test_init_app ( self ) : <EOL> pusher = Pusher ( ) <EOL> pusher . init_app ( self . app ) <EOL> self . _assert_init ( pusher ) <EOL> def test_options ( self ) : <EOL> pusher = Pusher ( ) <EOL> pusher . init_app ( self . app , host = '<STR_LIT>' , timeout = <NUM_LIT:20> ) <EOL> self . assertEqual ( pusher . host , '<STR_LIT>' ) <EOL> self . assertEqual ( pusher . timeout , <NUM_LIT:20> ) <EOL> def test_override_config ( self ) : <EOL> pusher = Pusher ( ) <EOL> pusher . init_app ( self . app , port = <NUM_LIT> ) <EOL> self . assertEqual ( pusher . port , <NUM_LIT> ) <EOL> def _assert_init ( self , pusher ) : <EOL> for k in [ ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT:key>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT:port>' , '<STR_LIT>' ) ] : <EOL> self . assertEqual ( getattr ( pusher , k [ <NUM_LIT:0> ] ) , self . app . config [ k [ <NUM_LIT:1> ] ] ) </s>
