我想测试一个像这样的简单函数,叫做’posting.py’:
导入请求
def post(): url =“https://api.trello.com/1/cards” params = {“key”:“my_key”, ” …
非常一般:
class Mytest(unittest.TestCase): def test_post(self): response = post() self.assertEqual(response.status_code, 200)