]> jfr.im git - z_archive/twitter.git/commitdiff
Add a test for method_for_uri()
authorBeat Bolli <redacted>
Wed, 24 Sep 2014 16:55:26 +0000 (18:55 +0200)
committerBeat Bolli <redacted>
Wed, 24 Sep 2014 19:04:34 +0000 (21:04 +0200)
tests/test_sanity.py

index 6e5f0c492a7880e4f13ff06e8fe5e502011e9bb6..bb37e10be4dcbdcde9dcca04b1fa4db7419c2c8d 100644 (file)
@@ -7,7 +7,7 @@ import pickle
 import json
 
 from twitter import Twitter, NoAuth, OAuth, read_token_file, TwitterHTTPError
-from twitter.api import TwitterDictResponse, TwitterListResponse
+from twitter.api import TwitterDictResponse, TwitterListResponse, POST_ACTIONS, method_for_uri
 from twitter.cmdline import CONSUMER_KEY, CONSUMER_SECRET
 
 noauth = NoAuth()
@@ -112,3 +112,9 @@ def test_jsonifability():
     res2 = json.loads(p)
     assert res == res2
     assert res2[2] == 3
+
+
+def test_method_for_uri():
+    for action in POST_ACTIONS:
+        assert method_for_uri(get_random_str() + '/' + action) == 'POST'
+    assert method_for_uri('statuses/timeline') == 'GET'