poco_test.py 文件源码

python
阅读 45 收藏 0 点赞 0 评论 0

项目:poco 作者: shiwaforce 项目源码 文件源码
def test_add_and_remove_config(self):
        self.init_with_remote_catalog()
        with self.captured_output() as (out, err):
            StateHolder.skip_docker = True
            poco = Poco(home_dir=self.tmpdir, argv=["catalog", "config", "add", "teszt", "ssh://teszt.teszt/teszt"])
            poco.run()
        self.assertEqual(0, len(err.getvalue()))
        data = dict()
        data["teszt"] = dict()
        data["teszt"]["repositoryType"] = "git"
        data["teszt"]["server"] = "ssh://teszt.teszt/teszt"

        self.assertIn(yaml.dump(data, default_flow_style=False, default_style='', indent=4).strip(),
                      out.getvalue().strip())
        self.clean_states()
        with self.captured_output() as (out, err):
            StateHolder.skip_docker = True
            poco = Poco(home_dir=self.tmpdir, argv=["catalog", "config", "remove", "teszt"])
            poco.run()
        self.assertEqual(0, len(err.getvalue()))
        self.assertNotIn("teszt", out.getvalue().strip())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号