<s> import os <EOL> import requests <EOL> from hpsdnclient . tests . base import ApiTestCase <EOL> from hpsdnclient . error import NotFound <EOL> class TestCoreMixin ( ApiTestCase ) : <EOL> def test_get_support ( self ) : <EOL> support = self . api . get_support ( ) <EOL> self . assertTrue ( support ) <EOL> support = self . api . get_support ( id = "<STR_LIT>" ) <EOL> self . assertTrue ( support ) <EOL> support = self . api . get_support ( fields = "<STR_LIT:content>" ) <EOL> self . assertTrue ( support ) <EOL> support = self . api . get_support ( id = "<STR_LIT>" , fields = "<STR_LIT:content>" ) <EOL> self . assertTrue ( support ) <EOL> def test_add_license_get_details_and_deactivate ( self ) : <EOL> pass <EOL> def test_get_install_id ( self ) : <EOL> install_id = self . api . get_install_id ( ) <EOL> self . assertTrue ( install_id ) <EOL> def test_get_apps ( self ) : <EOL> apps = self . api . get_apps ( ) <EOL> self . assertTrue ( apps ) <EOL> def test_get_app_info ( self ) : <EOL> app_info = self . api . get_app_info ( "<STR_LIT>" ) <EOL> self . assertTrue ( app_info ) <EOL> def test_upload_start_and_uninstall_app ( self ) : <EOL> r = requests . get ( "<STR_LIT>" , stream = True ) <EOL> with open ( "<STR_LIT>" , "<STR_LIT:wb>" ) as f : <EOL> for chunk in r . iter_content ( chunk_size = <NUM_LIT> ) : <EOL> if chunk : <EOL> f . write ( chunk ) <EOL> f . flush ( ) <EOL> self . api . upload_app ( "<STR_LIT>" ) <EOL> app = self . api . get_app_info ( "<STR_LIT>" ) <EOL> self . assertEquals ( "<STR_LIT>" , app . state ) <EOL> self . api . manage_app ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> app = self . api . get_app_info ( "<STR_LIT>" ) <EOL> self . assertEquals ( "<STR_LIT>" , app . state ) <EOL> self . api . manage_app ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> app = self . api . get_app_info ( "<STR_LIT>" ) <EOL> self . assertEquals ( "<STR_LIT>" , app . state ) <EOL> self . api . uninstall_app ( "<STR_LIT>" ) <EOL> self . assertRaises ( NotFound , self . api . get_app_info , "<STR_LIT>" ) <EOL> os . remove ( "<STR_LIT>" ) <EOL> def test_get_app_health ( self ) : <EOL> app_health = self . api . get_app_health ( "<STR_LIT>" ) <EOL> self . assertTrue ( app_health ) <EOL> def test_download_logs ( self ) : <EOL> logs = self . api . download_logs ( ) <EOL> self . assertTrue ( os . path . isfile ( logs ) ) <EOL> os . remove ( logs ) <EOL> def test_login ( self ) : <EOL> login = self . api . login ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> url = "<STR_LIT>" . format ( os . getenv ( "<STR_LIT>" ) ) <EOL> headers = { "<STR_LIT>" : login [ "<STR_LIT>" ] } <EOL> r = requests . get ( url , headers = headers , verify = False ) <EOL> self . assertTrue ( <NUM_LIT:200> , r . status_code ) <EOL> def test_logout ( self ) : <EOL> login = self . api . login ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . api . logout ( login [ "<STR_LIT>" ] ) <EOL> url = "<STR_LIT>" . format ( os . getenv ( "<STR_LIT>" ) ) <EOL> headers = { "<STR_LIT>" : login [ "<STR_LIT>" ] } <EOL> r = requests . get ( url , headers = headers , verify = False ) <EOL> self . assertTrue ( <NUM_LIT> , r . status_code ) </s>
