1

我已经安装了以下库并完成了 twitter python 设置中的所有步骤:

httplib2-0.7.1 simplegeo-python-oauth2-1fcc1a6
python-twitter-0.8.2 simplejson-2.1.6

我在这里使用设置说明:http ://code.google.com/p/python-twitter/

当我运行 python setup.py test 时,我得到 17 个错误。这是输出的一个片段(对不起,很多):

testNewFromJsonDict (twitter_test.UserTest)
Test the twitter.User NewFromJsonDict method ... ok
testProperties (twitter_test.UserTest)
Test all of the twitter.User properties ... ok
testCreateFriendship (twitter_test.ApiTest)
Test the twitter.Api CreateFriendship method ... ERROR
testDestroyDirectMessage (twitter_test.ApiTest)
Test the twitter.Api DestroyDirectMessage method ... ERROR
testDestroyFriendship (twitter_test.ApiTest)
Test the twitter.Api DestroyFriendship method ... ERROR
testDestroyStatus (twitter_test.ApiTest)
Test the twitter.Api DestroyStatus method ... ERROR
testGetDirectMessages (twitter_test.ApiTest)
Test the twitter.Api GetDirectMessages method ... ERROR
testGetFeatured (twitter_test.ApiTest)
Test the twitter.Api GetFeatured method ... ERROR
testGetFollowers (twitter_test.ApiTest)
Test the twitter.Api GetFollowers method ... ERROR
testGetFriends (twitter_test.ApiTest)
Test the twitter.Api GetFriends method ... ERROR
testGetFriendsTimeline (twitter_test.ApiTest)
Test the twitter.Api GetFriendsTimeline method ... ERROR
testGetPublicTimeline (twitter_test.ApiTest)
Test the twitter.Api GetPublicTimeline method ... ERROR
testGetReplies (twitter_test.ApiTest)
Test the twitter.Api GetReplies method ... ERROR
testGetStatus (twitter_test.ApiTest)
Test the twitter.Api GetStatus method ... ERROR
testGetUser (twitter_test.ApiTest)
Test the twitter.Api GetUser method ... ERROR
testGetUserTimeline (twitter_test.ApiTest)
Test the twitter.Api GetUserTimeline method ... ERROR
testPostDirectMessage (twitter_test.ApiTest)
Test the twitter.Api PostDirectMessage method ... ERROR
testPostUpdate (twitter_test.ApiTest)
Test the twitter.Api PostUpdate method ... ERROR
testTwitterError (twitter_test.ApiTest)
Test that twitter responses containing an error message are wrapped. ... ERROR
4

1 回答 1

0

我认为您省略的错误消息包含用于故障排除的重要信息。让我猜猜 - 你从项目的下载部分下载了 tar.gz 文件,但由于某种原因没有将测试数据打包进去。所以失败的原因一定是它找不到所需的测试数据。您可以在其存储库中看到:http ://code.google.com/p/python-twitter/source/browse/#hg%2Ftestdata

如果这是真的,请不要惊慌。继续与 twitter API 进行真实世界的交互。

于 2011-08-31T05:10:32.320 回答