<s> import re <EOL> import uuid <EOL> from mock import patch <EOL> from ceph_deploy import conf <EOL> from ceph_deploy . cli import _main as main <EOL> from ceph_deploy . tests . directory import directory <EOL> def test_write_global_conf_section ( tmpdir ) : <EOL> fake_ip_addresses = lambda x : [ '<STR_LIT>' ] <EOL> with patch ( '<STR_LIT>' ) : <EOL> with patch ( '<STR_LIT>' , fake_ip_addresses ) : <EOL> with patch ( '<STR_LIT>' , lambda x : '<STR_LIT>' ) : <EOL> with patch ( '<STR_LIT>' , lambda : lambda x : x ) : <EOL> with directory ( str ( tmpdir ) ) : <EOL> main ( args = [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> with tmpdir . join ( '<STR_LIT>' ) . open ( ) as f : <EOL> cfg = conf . ceph . parse ( f ) <EOL> assert cfg . sections ( ) == [ '<STR_LIT>' ] <EOL> def pytest_funcarg__newcfg ( request ) : <EOL> tmpdir = request . getfuncargvalue ( '<STR_LIT>' ) <EOL> fake_ip_addresses = lambda x : [ '<STR_LIT>' ] <EOL> def new ( * args ) : <EOL> with patch ( '<STR_LIT>' , fake_ip_addresses ) : <EOL> with patch ( '<STR_LIT>' ) : <EOL> with patch ( '<STR_LIT>' , lambda x : '<STR_LIT>' ) : <EOL> with patch ( '<STR_LIT>' , lambda : lambda x : x ) : <EOL> with directory ( str ( tmpdir ) ) : <EOL> main ( args = [ '<STR_LIT>' ] + list ( args ) ) <EOL> with tmpdir . join ( '<STR_LIT>' ) . open ( ) as f : <EOL> cfg = conf . ceph . parse ( f ) <EOL> return cfg <EOL> return new <EOL> def test_uuid ( newcfg ) : <EOL> cfg = newcfg ( '<STR_LIT>' ) <EOL> fsid = cfg . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> uuid . UUID ( hex = fsid ) <EOL> UUID_RE = re . compile ( <EOL> r'<STR_LIT>' <EOL> + r'<STR_LIT>' <EOL> + r'<STR_LIT>' <EOL> + r'<STR_LIT>' <EOL> + r'<STR_LIT>' , <EOL> ) <EOL> assert UUID_RE . match ( fsid ) <EOL> def test_mons ( newcfg ) : <EOL> cfg = newcfg ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> mon_initial_members = cfg . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> assert mon_initial_members == '<STR_LIT>' <EOL> def test_defaults ( newcfg ) : <EOL> cfg = newcfg ( '<STR_LIT>' ) <EOL> assert cfg . get ( '<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert cfg . get ( '<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' <EOL> assert cfg . get ( '<STR_LIT>' , '<STR_LIT>' ) == '<STR_LIT>' </s>
