Esempio n. 1
0
    def test_retry(self):
        with HTTMock(error_mock):
            with self.assertRaises(SystemExit) as cm:
                iloveck101(self.thread_url)

        self.assertEqual(cm.exception.code, 'Oops, can not fetch the page')
Esempio n. 2
0
    def test_list(self):
        with HTTMock(list_mock, image_mock):
            iloveck101(self.list_url)

        with HTTMock(error_mock):
            iloveck101(self.list_url)
Esempio n. 3
0
    def test_not_ck101(self):
        with self.assertRaises(SystemExit) as cm:
            iloveck101('http://google.com/')

        self.assertEqual(cm.exception.code, 'This is not ck101 url')
Esempio n. 4
0
    def test_thread(self):

        with HTTMock(thread_mock, image_mock):
            iloveck101(self.thread_url)
Esempio n. 5
0
    def test_retry(self):
        with HTTMock(error_mock):
            with self.assertRaises(SystemExit) as cm:
                iloveck101(self.thread_url)

        self.assertEqual(cm.exception.code, 'Oops, can not fetch the page')
Esempio n. 6
0
    def test_not_ck101(self):
        with self.assertRaises(SystemExit) as cm:
            iloveck101('http://google.com/')

        self.assertEqual(cm.exception.code, 'This is not ck101 url')
Esempio n. 7
0
    def test_list(self):
        with HTTMock(list_mock, image_mock):
            iloveck101(self.list_url)

        with HTTMock(error_mock):
            iloveck101(self.list_url)
Esempio n. 8
0
    def test_thread(self):

        with HTTMock(thread_mock, image_mock):
            iloveck101(self.thread_url)