<s> from mock import patch <EOL> from test_helper import * <EOL> import mock <EOL> from azurectl . azurectl_exceptions import * <EOL> from azurectl . defaults import Defaults <EOL> class TestDefaults : <EOL> def __set_account_type_docopts ( self ) : <EOL> self . account_type_docopts = { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False <EOL> } <EOL> def __host_caching_docopts ( self , selection = None ) : <EOL> docopts = { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : False <EOL> } <EOL> if selection : <EOL> docopts [ selection ] = True <EOL> return docopts <EOL> def test_get_azure_domain ( self ) : <EOL> assert Defaults . get_azure_domain ( '<STR_LIT>' ) == '<STR_LIT>' <EOL> @ raises ( AzureDomainLookupError ) <EOL> def test_get_azure_domain_raises ( self ) : <EOL> Defaults . get_azure_domain ( '<STR_LIT>' ) <EOL> def test_set_attribute ( self ) : <EOL> class X : <EOL> def __init__ ( self ) : <EOL> self . name = '<STR_LIT:value>' <EOL> instance = X ( ) <EOL> Defaults . set_attribute ( instance , '<STR_LIT:name>' , '<STR_LIT:foo>' ) <EOL> assert instance . name == '<STR_LIT:foo>' <EOL> def test_get_attribute ( self ) : <EOL> class X : <EOL> def __init__ ( self ) : <EOL> self . name = '<STR_LIT:value>' <EOL> instance = X ( ) <EOL> Defaults . get_attribute ( instance , '<STR_LIT:name>' ) <EOL> assert instance . name == '<STR_LIT:value>' <EOL> def test_account_type_for_docopts ( self ) : <EOL> self . __set_account_type_docopts ( ) <EOL> self . account_type_docopts [ '<STR_LIT>' ] = True <EOL> result = Defaults . account_type_for_docopts ( self . account_type_docopts ) <EOL> assert result == '<STR_LIT>' <EOL> self . __set_account_type_docopts ( ) <EOL> self . account_type_docopts [ '<STR_LIT>' ] = True <EOL> result = Defaults . account_type_for_docopts ( self . account_type_docopts ) <EOL> assert result == '<STR_LIT>' <EOL> self . __set_account_type_docopts ( ) <EOL> self . account_type_docopts [ '<STR_LIT>' ] = True <EOL> result = Defaults . account_type_for_docopts ( self . account_type_docopts ) <EOL> assert result == '<STR_LIT>' <EOL> self . __set_account_type_docopts ( ) <EOL> self . account_type_docopts [ '<STR_LIT>' ] = True <EOL> result = Defaults . account_type_for_docopts ( self . account_type_docopts ) <EOL> assert result == '<STR_LIT>' <EOL> def test_default_account_type_for_docopts ( self ) : <EOL> self . __set_account_type_docopts ( ) <EOL> result = Defaults . account_type_for_docopts ( self . account_type_docopts ) <EOL> assert result == '<STR_LIT>' <EOL> def test_docopt_for_account_type ( self ) : <EOL> result = Defaults . docopt_for_account_type ( '<STR_LIT>' ) <EOL> assert result == '<STR_LIT>' <EOL> result = Defaults . docopt_for_account_type ( '<STR_LIT>' ) <EOL> assert result == '<STR_LIT>' <EOL> result = Defaults . docopt_for_account_type ( '<STR_LIT>' ) <EOL> assert result == '<STR_LIT>' <EOL> result = Defaults . docopt_for_account_type ( '<STR_LIT>' ) <EOL> assert result == '<STR_LIT>' <EOL> def test_host_caching_for_docopts ( self ) : <EOL> host_caching_docopts = self . __host_caching_docopts ( '<STR_LIT>' ) <EOL> assert Defaults . host_caching_for_docopts ( host_caching_docopts ) == '<STR_LIT:None>' <EOL> host_caching_docopts = self . __host_caching_docopts ( '<STR_LIT>' ) <EOL> assert Defaults . host_caching_for_docopts ( host_caching_docopts ) == '<STR_LIT>' <EOL> host_caching_docopts = self . __host_caching_docopts ( '<STR_LIT>' ) <EOL> assert Defaults . host_caching_for_docopts ( host_caching_docopts ) == '<STR_LIT>' <EOL> def test_default_host_caching_for_docopts ( self ) : <EOL> host_caching_docopts = self . __host_caching_docopts ( ) <EOL> assert Defaults . host_caching_for_docopts ( host_caching_docopts ) == '<STR_LIT>' </s>
