core/domain/suggestion_services_test.py
File suggestion_services_test.py
has 6543 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
SuggestionIntegrationTests
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SuggestionIntegrationTests(test_utils.GenericTestBase):
EXP_ID: Final = 'exp1'
TOPIC_ID: Final = 'topic1'
STORY_ID: Final = 'story1'
SuggestionServicesUnitTests
has 44 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SuggestionServicesUnitTests(test_utils.GenericTestBase):
"""Test the functions in suggestion_services."""
score_category: str = (
suggestion_models.SCORE_TYPE_CONTENT +
SuggestionGetServicesUnitTests
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class SuggestionGetServicesUnitTests(test_utils.GenericTestBase):
score_category: str = (
suggestion_models.SCORE_TYPE_TRANSLATION +
suggestion_models.SCORE_CATEGORY_DELIMITER + 'English')
ReviewableSuggestionEmailInfoUnitTests
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ReviewableSuggestionEmailInfoUnitTests(
test_utils.GenericTestBase):
"""Tests the methods related to the ReviewableSuggestionEmailInfo class.
"""
CommunityContributionStatsUnitTests
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class CommunityContributionStatsUnitTests(test_utils.GenericTestBase):
"""Test the functionality related to updating the community contribution
stats.
TODO(#10957): It is currently not possible to resubmit a rejected
GetSuggestionsWaitingForReviewInfoToNotifyReviewersUnitTests
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class GetSuggestionsWaitingForReviewInfoToNotifyReviewersUnitTests(
test_utils.GenericTestBase):
"""Test the ability of the
get_suggestions_waitng_for_review_info_to_notify_reviewers method
in suggestion services, which is used to retrieve the information required
Function test_update_question_stats_when_suggestion_is_accepted
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_question_stats_when_suggestion_is_accepted(
self) -> None:
# This test case will check stats of the reviewer and the submitter
# when a question suggestion is accepted.
# Steps required in the setup phase before testing.
Function test_update_translation_review_stats_when_suggestion_is_accepted
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_translation_review_stats_when_suggestion_is_accepted(
self) -> None:
# This test case will check stats of the reviewer and the submitter
# when a translation suggestion is accepted.
# Steps required in the setup phase before testing.
Function test_update_question_stats_when_suggestion_is_edited
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_question_stats_when_suggestion_is_edited(
self
) -> None:
# This test case will check stats of the reviewer and the submitter
# when a question suggestion is accepted with reviewer edits.
Function test_update_translation_review_stats_when_suggestion_is_edited
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_translation_review_stats_when_suggestion_is_edited(
self) -> None:
# This test case will check stats of the reviewer and the submitter
# when a translation suggestion is accepted with reviewer edits.
# Steps required in the setup phase before testing.
Function test_update_question_stats_when_suggestion_is_rejected
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_question_stats_when_suggestion_is_rejected(
self) -> None:
# This test case will check stats of the reviewer and the submitter
# when a question suggestion is rejected.
# Steps required in the setup phase before testing.
Function test_update_translation_review_stats_when_suggestion_is_rejected
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_translation_review_stats_when_suggestion_is_rejected(
self) -> None:
# This test case will check stats of the reviewer and the submitter
# when a translation suggestion is rejected.
# Steps required in the setup phase before testing.
Function setUp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def setUp(self) -> None:
super().setUp()
self.signup(self.OWNER_EMAIL, self.OWNER_USERNAME)
self.signup(self.EDITOR_EMAIL, self.EDITOR_USERNAME)
self.signup(self.AUTHOR_EMAIL, 'author')
Function test_update_question_contribution_stats_when_submitting
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_update_question_contribution_stats_when_submitting(self) -> None:
# Steps required in the setup phase before testing.
# 1. Save new skills.
# 2. Save a topic assigning skills for it.
# 3. Create a question suggestion.
Function test_get_submitted_suggestions_by_offset
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def test_get_submitted_suggestions_by_offset(self) -> None:
self._create_translation_suggestion_with_language_code('hi')
self._create_translation_suggestion_with_language_code('pt')
question_1_skill_id = 'skill1'
question_2_skill_id = 'skill2'
Function mock_update_exploration
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def mock_update_exploration(