core/domain/suggestion_services_test.py

Summary

Maintainability
F
3 wks
Test Coverage

File suggestion_services_test.py has 6543 lines of code (exceeds 250 allowed). Consider refactoring.
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
Severity: Major
Found in core/domain/suggestion_services_test.py - About 2 wks to fix

    SuggestionIntegrationTests has 46 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SuggestionIntegrationTests(test_utils.GenericTestBase):
    
        EXP_ID: Final = 'exp1'
        TOPIC_ID: Final = 'topic1'
        STORY_ID: Final = 'story1'
    Severity: Minor
    Found in core/domain/suggestion_services_test.py - About 6 hrs to fix

      SuggestionServicesUnitTests has 44 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class SuggestionServicesUnitTests(test_utils.GenericTestBase):
          """Test the functions in suggestion_services."""
      
          score_category: str = (
              suggestion_models.SCORE_TYPE_CONTENT +
      Severity: Minor
      Found in core/domain/suggestion_services_test.py - About 6 hrs to fix

        SuggestionGetServicesUnitTests has 35 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class SuggestionGetServicesUnitTests(test_utils.GenericTestBase):
            score_category: str = (
                suggestion_models.SCORE_TYPE_TRANSLATION +
                suggestion_models.SCORE_CATEGORY_DELIMITER + 'English')
        
        
        Severity: Minor
        Found in core/domain/suggestion_services_test.py - About 4 hrs to fix

          ReviewableSuggestionEmailInfoUnitTests has 26 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class ReviewableSuggestionEmailInfoUnitTests(
                  test_utils.GenericTestBase):
              """Tests the methods related to the ReviewableSuggestionEmailInfo class.
              """
          
          
          Severity: Minor
          Found in core/domain/suggestion_services_test.py - About 3 hrs to fix

            CommunityContributionStatsUnitTests has 26 functions (exceeds 20 allowed). Consider refactoring.
            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
            Severity: Minor
            Found in core/domain/suggestion_services_test.py - About 3 hrs to fix

              GetSuggestionsWaitingForReviewInfoToNotifyReviewersUnitTests has 22 functions (exceeds 20 allowed). Consider refactoring.
              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
              Severity: Minor
              Found in core/domain/suggestion_services_test.py - About 2 hrs to fix

                Function test_update_question_stats_when_suggestion_is_accepted has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                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.
                Severity: Minor
                Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                  Function test_update_translation_review_stats_when_suggestion_is_accepted has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  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.
                  Severity: Minor
                  Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                    Function test_update_question_stats_when_suggestion_is_edited has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    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.
                    Severity: Minor
                    Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                      Function test_update_translation_review_stats_when_suggestion_is_edited has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      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.
                      Severity: Minor
                      Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                        Function test_update_question_stats_when_suggestion_is_rejected has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        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.
                        Severity: Minor
                        Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                          Function test_update_translation_review_stats_when_suggestion_is_rejected has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          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.
                          Severity: Minor
                          Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                            Function setUp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            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')
                            Severity: Minor
                            Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                              Function test_update_question_contribution_stats_when_submitting has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              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.
                              Severity: Minor
                              Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                                Function test_get_submitted_suggestions_by_offset has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                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'
                                Severity: Minor
                                Found in core/domain/suggestion_services_test.py - About 1 hr to fix

                                  Function mock_update_exploration has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def mock_update_exploration(
                                  Severity: Minor
                                  Found in core/domain/suggestion_services_test.py - About 35 mins to fix

                                    There are no issues that match your filters.

                                    Category
                                    Status