<s> import unittest <EOL> import json <EOL> import sys <EOL> import os <EOL> import requests <EOL> PATH = os . path . dirname ( os . path . realpath ( __file__ ) ) <EOL> sys . path . append ( os . path . join ( os . path . join ( os . path . join ( PATH , '<STR_LIT:..>' ) , '<STR_LIT:..>' ) , '<STR_LIT>' ) ) <EOL> import opsmgr <EOL> class VerifyApp4 ( unittest . TestCase ) : <EOL> def getEnv ( self , url ) : <EOL> headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } <EOL> response = requests . get ( url + '<STR_LIT>' , headers = headers ) <EOL> response . raise_for_status ( ) <EOL> return response . json ( ) <EOL> def setUp ( self ) : <EOL> self . cfinfo = opsmgr . get_cfinfo ( ) <EOL> self . proxy = '<STR_LIT>' + self . cfinfo [ '<STR_LIT>' ] <EOL> self . env = self . getEnv ( self . proxy ) <EOL> self . host = self . env . get ( '<STR_LIT>' ) <EOL> if self . host is not None : <EOL> self . url = self . proxy + '<STR_LIT>' + self . host + '<STR_LIT>' <EOL> def skipIfNoHost ( self ) : <EOL> if self . host is None : <EOL> self . skipTest ( "<STR_LIT>" ) <EOL> def test_apps_receive_app4_host ( self ) : <EOL> self . assertTrue ( self . env . get ( '<STR_LIT>' ) is not None ) <EOL> self . assertTrue ( self . env . get ( '<STR_LIT>' ) is not None ) <EOL> def test_responds_to_hello ( self ) : <EOL> self . skipIfNoHost ( ) <EOL> headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } <EOL> response = requests . get ( self . url + '<STR_LIT>' , headers = headers ) <EOL> response . raise_for_status ( ) <EOL> @ unittest . expectedFailure <EOL> def test_receives_custom_properties ( self ) : <EOL> self . skipIfNoHost ( ) <EOL> headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } <EOL> response = requests . get ( self . url + '<STR_LIT>' , headers = headers ) <EOL> response . raise_for_status ( ) <EOL> env = response . json ( ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , "<STR_LIT>" ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( env . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
