コード例 #1
0
ファイル: test_cache.py プロジェクト: johnwheeler/flask-ask
    def test_pushing_works_like_a_stack(self):
        push_stream(self.cache, self.user_id, 'junk')
        push_stream(self.cache, self.user_id, self.token)

        self.assertEqual(self.token, pop_stream(self.cache, self.user_id))
        self.assertEqual('junk', pop_stream(self.cache, self.user_id))
        self.assertIsNone(pop_stream(self.cache, self.user_id))
コード例 #2
0
ファイル: test_cache.py プロジェクト: Christina96/flask-ask
    def test_pushing_works_like_a_stack(self):
        push_stream(self.cache, self.user_id, 'junk')
        push_stream(self.cache, self.user_id, self.token)

        self.assertEqual(self.token, pop_stream(self.cache, self.user_id))
        self.assertEqual('junk', pop_stream(self.cache, self.user_id))
        self.assertIsNone(pop_stream(self.cache, self.user_id))
コード例 #3
0
ファイル: test_cache.py プロジェクト: johnwheeler/flask-ask
    def test_set_overrides_stack(self):
        push_stream(self.cache, self.user_id, '1')
        push_stream(self.cache, self.user_id, '2')
        self.assertEqual('2', top_stream(self.cache, self.user_id))

        set_stream(self.cache, self.user_id, '3')
        self.assertEqual('3', pop_stream(self.cache, self.user_id))
        self.assertIsNone(pop_stream(self.cache, self.user_id))
コード例 #4
0
ファイル: test_cache.py プロジェクト: Christina96/flask-ask
    def test_set_overrides_stack(self):
        push_stream(self.cache, self.user_id, '1')
        push_stream(self.cache, self.user_id, '2')
        self.assertEqual('2', top_stream(self.cache, self.user_id))

        set_stream(self.cache, self.user_id, '3')
        self.assertEqual('3', pop_stream(self.cache, self.user_id))
        self.assertIsNone(pop_stream(self.cache, self.user_id))
コード例 #5
0
    def test_set_overrides_stack(self):
        push_stream(self.cache, self.user_id, "1")
        push_stream(self.cache, self.user_id, "2")
        self.assertEqual("2", top_stream(self.cache, self.user_id))

        set_stream(self.cache, self.user_id, "3")
        self.assertEqual("3", pop_stream(self.cache, self.user_id))
        self.assertIsNone(pop_stream(self.cache, self.user_id))
コード例 #6
0
ファイル: test_cache.py プロジェクト: johnwheeler/flask-ask
    def test_adding_removing_stream(self):
        self.assertTrue(push_stream(self.cache, self.user_id, self.token))

        # peak at the top
        self.assertEqual(self.token, top_stream(self.cache, self.user_id))
        self.assertIsNone(top_stream(self.cache, 'not dave'))

        # pop it off
        self.assertEqual(self.token, pop_stream(self.cache, self.user_id))
        self.assertIsNone(top_stream(self.cache, self.user_id))
コード例 #7
0
ファイル: test_cache.py プロジェクト: Christina96/flask-ask
    def test_adding_removing_stream(self):
        self.assertTrue(push_stream(self.cache, self.user_id, self.token))

        # peak at the top
        self.assertEqual(self.token, top_stream(self.cache, self.user_id))
        self.assertIsNone(top_stream(self.cache, 'not dave'))

        # pop it off
        self.assertEqual(self.token, pop_stream(self.cache, self.user_id))
        self.assertIsNone(top_stream(self.cache, self.user_id))