@@ -0,0 +1,1473 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Aimport random%0Aimport pickle%0Aimport json%0A%0Afrom fanpy import Fanfou, FanfouHTTPError, NoAuth%0Afrom fanpy.api import FanfouDictResponse, FanfouListResponse, POST_ACTIONS, method_for_uri%0A%0Anoauth = NoAuth()%0Afanfou_na = Fanfou(auth=noauth)%0A%0AAZaz = 'abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'%0A%0A%0Adef get_random_str():%0A    return ''.join(random.choice(AZaz) for _ in range(10))%0A%0A%0Adef test_FanfouHTTPError_raised_for_invalid_oauth():%0A    test_passed = False%0A    try:%0A        fanfou_na.statuses.mentions()%0A    except FanfouHTTPError:%0A        test_passed = True%0A    assert test_passed%0A%0A%0Adef test_pickle_ability():%0A    res = FanfouDictResponse(%7B'a': 'b'%7D)%0A    p = pickle.dumps(res)%0A    res2 = pickle.loads(p)%0A    assert res == res2%0A    assert res2%5B'a'%5D == 'b'%0A%0A    res = FanfouListResponse(%5B1, 2, 3%5D)%0A    p = pickle.dumps(res)%0A    res2 = pickle.loads(p)%0A    assert res == res2%0A    assert res2%5B2%5D == 3%0A%0A%0Adef test_json_ability():%0A    res = FanfouDictResponse(%7B'a': 'b'%7D)%0A    p = json.dumps(res)%0A    res2 = json.loads(p)%0A    assert res == res2%0A    assert res2%5B'a'%5D == 'b'%0A%0A    res = FanfouListResponse(%5B1, 2, 3%5D)%0A    p = json.dumps(res)%0A    res2 = json.loads(p)%0A    assert res == res2%0A    assert res2%5B2%5D == 3%0A%0A%0Adef test_method_for_uri():%0A    for action in POST_ACTIONS:%0A        assert method_for_uri(get_random_str() + '/' + action) == 'POST'%0A    assert method_for_uri('statuses/home_timeline') == 'GET'%0A

Add test_sanity.py