<s> import os <EOL> import click <EOL> from supernova import config , utils <EOL> class TestUtils ( object ) : <EOL> def test_assemble_username ( self ) : <EOL> result = utils . assemble_username ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert result == "<STR_LIT>" <EOL> def test_env_var_warning ( self ) : <EOL> os . environ [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> result = utils . check_environment_presets ( ) <EOL> assert not result <EOL> def test_env_var_pass ( self ) : <EOL> os . environ = { "<STR_LIT>" : '<STR_LIT:value>' } <EOL> result = utils . check_environment_presets ( ) <EOL> assert result <EOL> def test_confirm_credential_display_forced ( self ) : <EOL> result = utils . confirm_credential_display ( True ) <EOL> assert result <EOL> def test_confirm_credential_display_not_forced ( self , monkeypatch ) : <EOL> def mockreturn ( text ) : <EOL> return True <EOL> monkeypatch . setattr ( click , "<STR_LIT>" , mockreturn ) <EOL> result = utils . confirm_credential_display ( ) <EOL> assert result <EOL> def test_is_valid_environment_success ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> nova_creds = config . load_config ( testcfg ) <EOL> result = utils . is_valid_environment ( '<STR_LIT>' , nova_creds ) <EOL> assert result <EOL> def test_is_valid_environment_failure ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> nova_creds = config . load_config ( testcfg ) <EOL> result = utils . is_valid_environment ( '<STR_LIT>' , nova_creds ) <EOL> assert not result <EOL> def test_is_valid_group_success ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> nova_creds = config . load_config ( testcfg ) <EOL> result = utils . is_valid_group ( '<STR_LIT>' , nova_creds ) <EOL> assert result <EOL> def test_is_valid_group_failure ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> nova_creds = config . load_config ( testcfg ) <EOL> result = utils . is_valid_group ( '<STR_LIT>' , nova_creds ) <EOL> assert not result <EOL> def test_get_envs_in_group ( self ) : <EOL> testcfg = "<STR_LIT>" . format ( os . getcwd ( ) ) <EOL> nova_creds = config . load_config ( testcfg ) <EOL> result = utils . get_envs_in_group ( '<STR_LIT>' , nova_creds ) <EOL> assert len ( result ) == <NUM_LIT:3> <EOL> assert '<STR_LIT>' in result <EOL> def test_rm_prefix ( self ) : <EOL> assert utils . rm_prefix ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert utils . rm_prefix ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert utils . rm_prefix ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert utils . rm_prefix ( '<STR_LIT>' ) == '<STR_LIT>' </s>
