コード例 #1
0
 def test_that_implements_abstract_base_class(self):
     MockApi(
         access_token_key=ACCESS_TOKEN,
         access_token_secret=ACCESS_TOKEN_SECRET,
     )
コード例 #2
0
ファイル: test_core.py プロジェクト: semtle/turses
 def setUp(self):
     self.timelines = TimelineList()
     self.controller = Controller(ui=Mock(),
                                  api=MockApi('foo', 'bar'),
                                  timelines=self.timelines)
コード例 #3
0
    TimelineFactory,
    is_home_timeline,
    is_mentions_timeline,
    is_favorites_timeline,
    is_messages_timeline,
    is_own_timeline,
    is_search_timeline,
    is_user_timeline,
    is_retweets_of_me_timeline,
    is_thread_timeline,
)

ACCESS_TOKEN = 'Yohohohoooo'
ACCESS_TOKEN_SECRET = 'Skull joke!'

mock_api = MockApi(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)


class AsyncApiTest(unittest.TestCase):
    def test_that_implements_abstract_base_class(self):
        AsyncApi(
            MockApi,
            access_token_key=ACCESS_TOKEN,
            access_token_secret=ACCESS_TOKEN_SECRET,
        )


class MockApiTest(unittest.TestCase):
    def test_that_implements_abstract_base_class(self):
        MockApi(
            access_token_key=ACCESS_TOKEN,
コード例 #4
0
ファイル: test_session.py プロジェクト: semtle/turses
import unittest

from turses.api.debug import MockApi
from turses.models import TimelineList
from turses.session import (
    Session,
    clean_timeline_list_string,
)
from turses.api.helpers import (
    is_home_timeline,
    is_mentions_timeline,
    is_messages_timeline,
    is_search_timeline,
)

mock_api = MockApi('foo', 'bar')


class SessionTest(unittest.TestCase):
    def setUp(self):
        self.session = Session(mock_api)

    def test_clean_timeline_list_string(self):
        self.assertEqual(clean_timeline_list_string(''), [])

        self.assertEqual(clean_timeline_list_string('  '), [])

        self.assertEqual(clean_timeline_list_string('home'), ['home'])

        self.assertEqual(clean_timeline_list_string('  home, '), ['home'])