<s> import pytest <EOL> from ceph_deploy . cli import get_parser <EOL> COMP_FLAGS = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:all>' <EOL> ] <EOL> class TestParserInstall ( object ) : <EOL> def setup ( self ) : <EOL> self . parser = get_parser ( ) <EOL> def test_install_help ( self , capsys ) : <EOL> with pytest . raises ( SystemExit ) : <EOL> self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert '<STR_LIT>' in out <EOL> assert '<STR_LIT>' in out <EOL> assert '<STR_LIT>' in out <EOL> def test_install_host_required ( self , capsys ) : <EOL> with pytest . raises ( SystemExit ) : <EOL> self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert "<STR_LIT>" in err <EOL> def test_install_one_host ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . host == [ '<STR_LIT>' ] <EOL> def test_install_multiple_hosts ( self ) : <EOL> hostnames = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> args = self . parser . parse_args ( [ '<STR_LIT>' ] + hostnames ) <EOL> assert frozenset ( args . host ) == frozenset ( hostnames ) <EOL> def test_install_release_default_is_none ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . release is None <EOL> assert args . version_kind == "<STR_LIT>" <EOL> def test_install_release ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . release == "<STR_LIT>" <EOL> assert args . version_kind == "<STR_LIT>" <EOL> @ pytest . mark . skipif ( reason = "<STR_LIT>" ) <EOL> def test_install_release_bad_codename ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . release != "<STR_LIT>" <EOL> def test_install_testing_default_is_none ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . testing is None <EOL> assert args . version_kind == "<STR_LIT>" <EOL> def test_install_testing_true ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert len ( args . testing ) == <NUM_LIT:0> <EOL> assert args . version_kind == "<STR_LIT>" <EOL> def test_install_dev_disabled_by_default ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . dev == "<STR_LIT>" <EOL> assert args . version_kind == "<STR_LIT>" <EOL> def test_install_dev_custom_version ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . dev == "<STR_LIT>" <EOL> assert args . version_kind == "<STR_LIT>" <EOL> @ pytest . mark . skipif ( reason = "<STR_LIT>" ) <EOL> def test_install_dev_option_default_is_master ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . dev == "<STR_LIT>" <EOL> assert args . version_kind == "<STR_LIT>" <EOL> def test_install_release_testing_mutex ( self , capsys ) : <EOL> with pytest . raises ( SystemExit ) : <EOL> self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert '<STR_LIT>' in err <EOL> def test_install_release_dev_mutex ( self , capsys ) : <EOL> with pytest . raises ( SystemExit ) : <EOL> self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert '<STR_LIT>' in err <EOL> def test_install_testing_dev_mutex ( self , capsys ) : <EOL> with pytest . raises ( SystemExit ) : <EOL> self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> out , err = capsys . readouterr ( ) <EOL> assert '<STR_LIT>' in err <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , COMP_FLAGS ) <EOL> def test_install_component_default_is_false ( self , comp ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert getattr ( args , '<STR_LIT>' % comp ) is False <EOL> @ pytest . mark . parametrize ( '<STR_LIT>' , COMP_FLAGS ) <EOL> def test_install_component_true ( self , comp ) : <EOL> args = self . parser . parse_args ( ( '<STR_LIT>' % comp ) . split ( ) ) <EOL> assert getattr ( args , '<STR_LIT>' % comp ) is True <EOL> def test_install_multi_component ( self ) : <EOL> args = self . parser . parse_args ( ( '<STR_LIT>' ) . split ( ) ) <EOL> assert args . install_mon <EOL> assert args . install_rgw <EOL> def test_install_adjust_repos_default_is_true ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . adjust_repos <EOL> def test_install_adjust_repos_false ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert not args . adjust_repos <EOL> def test_install_adjust_repos_false_with_custom_release ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . release == "<STR_LIT>" <EOL> assert not args . adjust_repos <EOL> def test_install_repo_default_is_false ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert not args . repo <EOL> def test_install_repo_true ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . repo <EOL> def test_install_local_mirror_default_is_none ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . local_mirror is None <EOL> def test_install_local_mirror_custom_path ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . local_mirror == "<STR_LIT>" <EOL> def test_install_repo_url_default_is_none ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . repo_url is None <EOL> def test_install_repo_url_custom_path ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . repo_url == "<STR_LIT>" <EOL> def test_install_gpg_url_default_is_none ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . gpg_url is None <EOL> def test_install_gpg_url_custom_path ( self ) : <EOL> args = self . parser . parse_args ( '<STR_LIT>' . split ( ) ) <EOL> assert args . gpg_url == "<STR_LIT>" </s>
