def test_set_superuser_password(tmpdir):
 with tmpdir.as_cwd():
  tmpdir.join('genconf').ensure(dir=True)
  make_default_config_if_needed('genconf/config.yaml')
  assert ('superuser_password_hash' not in Config('genconf/config.yaml').config)
  subprocess.check_call(['dcos_installer', '--set-superuser-password', 'foo'], cwd=str(tmpdir))
  config = Config('genconf/config.yaml')
  assert passlib.hash.sha512_crypt.verify('foo', config['superuser_password_hash'])

def test_set_superuser_password ( tmpdir ) : with tmpdir . as_cwd ( ) : tmpdir . join ( 'genconf' ) . ensure ( dir = True ) make_default_config_if_needed ( 'genconf/config.yaml' ) assert ( 'superuser_password_hash' not in Config ( 'genconf/config.yaml' ) . config ) subprocess . check_call ( [ 'dcos_installer' , '--set-superuser-password' , 'foo' ] , cwd = str ( tmpdir ) ) config = Config ( 'genconf/config.yaml' ) assert passlib . hash . sha512_crypt . verify ( 'foo' , config [ 'superuser_password_hash' ] )
test that --set-superuser-hash works .