test_test_function.py 文件源码

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

项目:pythonwhat 作者: datacamp 项目源码 文件源码
def test_Pass(self):
        self.data["DC_SCT"] = '''
# Test: import tweepy
import_msg = "Did you correctly import the required package?"
test_import("tweepy", same_as = True, not_imported_msg = import_msg, incorrect_as_msg = import_msg)

# Test: Predefined code
predef_msg = "You don't have to change any of the predefined code."
test_object("access_token", undefined_msg = predef_msg, incorrect_msg = predef_msg)
test_object("access_token_secret", undefined_msg = predef_msg, incorrect_msg = predef_msg)
test_object("consumer_key", undefined_msg = predef_msg, incorrect_msg = predef_msg)
test_object("consumer_secret", undefined_msg = predef_msg, incorrect_msg = predef_msg)

# Test: call to tweepy.OAuthHandler() and 'auth' variable
test_object("auth", do_eval = False)
test_function("tweepy.OAuthHandler")

# Test: call to auth.set_access_token()
test_function("auth.set_access_token")

success_msg("Awesome!")
        '''
        sct_payload = helper.run(self.data)
        self.assertTrue(sct_payload['correct'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号