<s> from __future__ import print_function , absolute_import , division <EOL> import pusher <EOL> import httpretty <EOL> import sys <EOL> import os <EOL> if ( sys . version_info < ( <NUM_LIT:2> , <NUM_LIT:7> ) ) : <EOL> import unittest2 as unittest <EOL> else : <EOL> import unittest <EOL> skip_test = ( sys . version_info [ <NUM_LIT:0> : <NUM_LIT:2> ] != ( <NUM_LIT:2> , <NUM_LIT:7> ) ) or os . environ . get ( "<STR_LIT>" ) <EOL> @ unittest . skipIf ( skip_test , "<STR_LIT>" ) <EOL> class TestGAEBackend ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> import pusher . gae <EOL> from google . appengine . api import apiproxy_stub_map , urlfetch_stub <EOL> apiproxy_stub_map . apiproxy = apiproxy_stub_map . APIProxyStubMap ( ) <EOL> apiproxy_stub_map . apiproxy . RegisterStub ( '<STR_LIT>' , <EOL> urlfetch_stub . URLFetchServiceStub ( ) ) <EOL> self . p = pusher . Pusher . from_url ( u'<STR_LIT>' , <EOL> backend = pusher . gae . GAEBackend ) <EOL> @ httpretty . activate <EOL> def test_trigger_gae_success ( self ) : <EOL> httpretty . register_uri ( httpretty . POST , "<STR_LIT>" , <EOL> body = "<STR_LIT:{}>" , <EOL> content_type = "<STR_LIT:application/json>" ) <EOL> response = self . p . trigger ( u'<STR_LIT>' , u'<STR_LIT:test>' , { u'<STR_LIT:data>' : u'<STR_LIT>' } ) <EOL> self . assertEqual ( response , { } ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
