def test_build_default_comment__link_repost_all_enabled(self): response_builder = ResponseBuilder(MagicMock()) search_results = self._get_link_search_results_matches_match() result = response_builder.build_default_comment(search_results, signature=True, stats=True, search_link=True, search_settings=True) self.assertEqual(LINK_REPOST_ALL_ENABLED, result)
def test_build_default_comment__image_oc_all_enabled_close_match(self): response_builder = ResponseBuilder(MagicMock()) search_results = self._get_image_search_results_no_match() search_results.closest_match = ImageSearchMatch('test.com', 1, Post(post_id='abc123', created_at=datetime.strptime( '2019-01-28 05:20:03', '%Y-%m-%d %H:%M:%S')), 5, 3, 32) result = response_builder.build_default_comment(search_results, signature=True, stats=True, search_link=True, search_settings=True) self.assertEqual(IMAGE_OC_ALL_ENABLED_ALL_ENABLED_NO_MEME, result)
def test_build_default_comment__image_repost_multi_match_all_enabled(self): response_builder = ResponseBuilder(MagicMock()) search_results = self._get_image_search_results_multi_match() result = response_builder.build_default_comment(search_results, signature=True, stats=True, search_link=True, search_settings=True) self.assertEqual(IMAGE_REPOST_MULTI_MATCH_ALL_ENABLED, result)
def test_build_default_comment__image_oc_only_search_settings(self): response_builder = ResponseBuilder(MagicMock()) search_results = self._get_image_search_results_no_match() result = response_builder.build_default_comment(search_results, signature=False, stats=False, search_link=False, search_settings=True) self.assertEqual(IMAGE_OC_ONLY_SEARCH_SETTINGS, result)
def test_build_default_comment__image_oc_no_sig_or_stat_or_search_link(self): response_builder = ResponseBuilder(MagicMock()) search_results = self._get_image_search_results_no_match() result = response_builder.build_default_comment(search_results, signature=False, stats=False, search_link=False, search_settings=False) self.assertEqual(IMAGE_OC_NO_CLOSE_NO_SIG_NO_STATS_NO_SEARCH, result)