コード例 #1
0
    def test_extract_content_assignment_direct(self, es_mock):
        post = MockObjects.get_mock_post_vidble()
        post.url = self.extracted_single_url_explore
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_content()

        es_mock.assert_called()
コード例 #2
0
    def test_extract_content_assignment_single_explore(self, es_mock):
        post = MockObjects.get_mock_post_vidble()
        post.url = 'https://vidble.com/explore/XOwqxH6Xz9'
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_content()

        es_mock.assert_called()
コード例 #3
0
    def test_extract_content_assignment_single_explore(self, es_mock):
        post = MockObjects.get_mock_post_vidble()
        post.url = post.url.replace('show', 'explore')
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_content()

        es_mock.assert_called()
コード例 #4
0
    def test_extract_content_explore_direct(self, es_mock):
        post = MockObjects.get_mock_post_vidble()
        post.url = 'https://vidble.com/explore/XOwqxH6Xz9.jpg'
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_content()

        self.assertEqual('https://vidble.com/XOwqxH6Xz9.jpg', ve.url)
        es_mock.assert_called()
コード例 #5
0
    def test_extract_single_show(self, s_mock):
        s_mock.return_value = self.get_single_soup_show()
        ve = VidbleExtractor(MockObjects.get_mock_post_vidble(),
                             MockObjects.get_blank_user())
        ve.extract_single()

        content = ve.extracted_content[0]
        self.assertEqual(self.extracted_single_url_show, content.url)
        self.check_output(content)
        self.assertTrue(len(ve.failed_extract_posts) == 0)
コード例 #6
0
    def test_extract_single_explore(self, s_mock):
        s_mock.return_value = self.get_single_soup()
        post = MockObjects.get_mock_post_vidble()
        post.url = 'https://vidble.com/explore/XOwqxH6Xz9'
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_single()

        content = ve.extracted_content[0]
        self.check_output(content)
        self.assertTrue(len(ve.failed_extract_posts) == 0)
コード例 #7
0
    def test_extract_single_explore(self, s_mock):
        s_mock.return_value = self.get_single_soup_explore()
        post = MockObjects.get_mock_post_vidble()
        post.url = post.url.replace('show', 'explore')
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_single()

        content = ve.extracted_content[0]
        self.assertEqual(self.extracted_single_url_explore, content.url)
        self.check_output(content)
        self.assertTrue(len(ve.failed_extract_posts) == 0)
コード例 #8
0
    def test_extract_album(self, j_mock):
        post = MockObjects.get_mock_post_vidible_album()
        j_mock.return_value = {"pics":
                                   ["//www.vidble.com/lkPvqs0yh5_med.png",
                                    "//www.vidble.com/F5DgE2O64b.gif",
                                    "//www.vidble.com/XOwqxH6Xz9_med.jpg",
                                    "//www.vidble.com/3a4xNLuO9M_med.png"]}
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_album()

        contents = ve.extracted_content
        self.check_output_album(contents)
        self.assertTrue(len(ve.failed_extract_posts) == 0)
コード例 #9
0
    def test_extract_content_assignment_single_show(self, es_mock):
        ve = VidbleExtractor(MockObjects.get_mock_post_vidble(),
                             MockObjects.get_blank_user())
        ve.extract_content()

        es_mock.assert_called()
コード例 #10
0
    def test_extract_content_assignment_direct(self, es_mock):
        post = MockObjects.get_mock_post_vidble_direct()
        ve = VidbleExtractor(post, MockObjects.get_blank_user())
        ve.extract_content()

        es_mock.assert_called()