core/domain/exp_services_test.py

Summary

Maintainability
F
1 mo
Test Coverage

File exp_services_test.py has 8658 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Severity: Major
Found in core/domain/exp_services_test.py - About 3 wks to fix

    ExplorationCreateAndDeleteUnitTests has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ExplorationCreateAndDeleteUnitTests(ExplorationServicesUnitTests):
        """Test creation and deletion methods."""
    
        def test_soft_deletion_of_exploration(self) -> None:
            """Test that soft deletion of exploration works correctly."""
    Severity: Minor
    Found in core/domain/exp_services_test.py - About 5 hrs to fix

      UpdateStateTests has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class UpdateStateTests(ExplorationServicesUnitTests):
          """Test updating a single state."""
      
          def setUp(self) -> None:
              super().setUp()
      Severity: Minor
      Found in core/domain/exp_services_test.py - About 3 hrs to fix

        ExplorationConversionPipelineTests has 25 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ExplorationConversionPipelineTests(ExplorationServicesUnitTests):
            """Tests the exploration model -> exploration conversion pipeline."""
        
            NEW_EXP_ID: Final = 'exp_id1'
        
        
        Severity: Minor
        Found in core/domain/exp_services_test.py - About 2 hrs to fix

          Function test_logged_in_user_progress_is_updated_correctly has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def test_logged_in_user_progress_is_updated_correctly(self) -> None:
                  self.login(self.VIEWER_EMAIL)
                  exp_user_data = exp_fetchers.get_exploration_user_data(
                      self.viewer_id, self.EXP_ID)
                  self.assertIsNone(exp_user_data)
          Severity: Major
          Found in core/domain/exp_services_test.py - About 2 hrs to fix

            Function test_get_image_filenames_from_exploration has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def test_get_image_filenames_from_exploration(self) -> None:
                    exploration = exp_domain.Exploration.create_default_exploration(
                        'eid', title='title', category='category')
                    exploration.add_states(['state1', 'state2', 'state3'])
                    state1 = exploration.states['state1']
            Severity: Minor
            Found in core/domain/exp_services_test.py - About 1 hr to fix

              Function test_logged_out_user_checkpoint_progress_is_updated_correctly has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def test_logged_out_user_checkpoint_progress_is_updated_correctly(
                      self
                  ) -> None:
                      logged_out_user_data = exp_fetchers.get_logged_out_user_progress(
                          self.UNIQUE_PROGRESS_URL_ID
              Severity: Minor
              Found in core/domain/exp_services_test.py - About 1 hr to fix

                Function test_update_interaction_answer_groups has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def test_update_interaction_answer_groups(self) -> None:
                        """Test updating of interaction_answer_groups."""
                        # We create a second state to use as a rule destination.
                        exploration = exp_fetchers.get_exploration_by_id(self.EXP_0_ID)
                        content_id_generator = translation_domain.ContentIdGenerator(
                Severity: Minor
                Found in core/domain/exp_services_test.py - About 1 hr to fix

                  Function test_get_exploration_snapshots_metadata has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def test_get_exploration_snapshots_metadata(self) -> None:
                          self.signup(self.SECOND_EMAIL, self.SECOND_USERNAME)
                          second_committer_id = self.get_user_id_from_email(self.SECOND_EMAIL)
                  
                          v1_exploration = self.save_new_valid_exploration(
                  Severity: Minor
                  Found in core/domain/exp_services_test.py - About 1 hr to fix

                    Function test_versioning_with_add_and_delete_states has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def test_versioning_with_add_and_delete_states(self) -> None:
                    
                            exploration = self.save_new_valid_exploration(
                                self.EXP_0_ID, self.owner_id)
                            change_list = [exp_domain.ExplorationChange({
                    Severity: Minor
                    Found in core/domain/exp_services_test.py - About 1 hr to fix

                      Function test_soft_deletion_of_multiple_explorations has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def test_soft_deletion_of_multiple_explorations(self) -> None:
                              """Test that soft deletion of explorations works correctly."""
                              # TODO(sll): Add tests for deletion of states and version snapshots.
                      
                              self.save_new_default_exploration(self.EXP_0_ID, self.owner_id)
                      Severity: Minor
                      Found in core/domain/exp_services_test.py - About 1 hr to fix

                        Function test_export_by_versions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def test_export_by_versions(self) -> None:
                                """Test export_to_dict() for different versions."""
                                self.maxDiff = None
                                exploration = self.save_new_valid_exploration(
                                    self.EXP_0_ID, self.owner_id)
                        Severity: Minor
                        Found in core/domain/exp_services_test.py - About 1 hr to fix

                          Function test_export_by_versions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def test_export_by_versions(self) -> None:
                                  """Test export_to_zip_file() for different versions."""
                                  exploration = self.save_new_valid_exploration(
                                      self.EXP_0_ID, self.owner_id, objective='The objective',
                                      category='Algebra')
                          Severity: Minor
                          Found in core/domain/exp_services_test.py - About 1 hr to fix

                            Function test_update_interaction_solutions has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def test_update_interaction_solutions(self) -> None:
                                    exploration = exp_fetchers.get_exploration_by_id(self.NEW_EXP_ID)
                                    self.assertIsNone(exploration.init_state.interaction.solution)
                            
                                    solution: Optional[state_domain.SolutionDict] = {
                            Severity: Minor
                            Found in core/domain/exp_services_test.py - About 1 hr to fix

                              There are no issues that match your filters.

                              Category
                              Status