def test_save_config(tempdir): """SgService.save_config :param tempdir: :return: """ config = Config("sge.cfg") with mock.patch("sg.service._confirm") as dummy: dummy.return_value = True with mock.patch("six.moves.input") as dum2: dum2.return_value = "dummy" SgService.save_config(config) assert (tempdir / 'sge.cfg').exists() assert (tempdir / 'aws_key').exists()