#29 fix unittests for missing koji profile
Merged 3 years ago by julian8628. Opened 3 years ago by julian8628.
julian8628/ursa-major ut-koji  into  master

@@ -51,6 +51,9 @@ 

  

          self.set_args()

  

+         self.koji_get_profile_module_patcher = patch('koji.get_profile_module')

+         self.koji_get_profile_module = self.koji_get_profile_module_patcher.start()

+ 

          self.koji_session_patcher = patch('koji.ClientSession')

          self.mock_koji_session = self.koji_session_patcher.start().return_value

  
@@ -61,6 +64,7 @@ 

      def tearDown(self):

          self.koji_session_patcher.stop()

          self.request_get_patcher.stop()

+         self.koji_get_profile_module_patcher.stop()

          try:

              shutil.rmtree(self.tmpdir)

          except:  # noqa

@@ -41,11 +41,16 @@ 

          self.mock_ClientSession = self.ClientSession_patcher.start()

          self.koji_session = self.mock_ClientSession.return_value

  

+         self.koji_get_profile_module_patcher = patch('koji.get_profile_module')

+         self.koji_get_profile_module = self.koji_get_profile_module_patcher.start()

+ 

          self.get_patcher = patch('requests.get')

          self.mock_get = self.get_patcher.start()

  

      def teardown_method(self, method):

          self.get_patcher.stop()

+         self.ClientSession_patcher.stop()

+         self.koji_get_profile_module_patcher.stop()

          os.unlink(self.tag_config_file)

  

      def write_tag_config_file(self, content):

@@ -52,6 +52,9 @@ 

  

          self.set_args()

  

+         self.koji_get_profile_module_patcher = patch('koji.get_profile_module')

+         self.koji_get_profile_module = self.koji_get_profile_module_patcher.start()

+ 

          self.koji_session_patcher = patch('koji.ClientSession')

          self.mock_koji_session = self.koji_session_patcher.start().return_value

  
@@ -62,6 +65,7 @@ 

      def tearDown(self):

          self.koji_session_patcher.stop()

          self.request_get_patcher.stop()

+         self.koji_get_profile_module_patcher.stop()

          try:

              shutil.rmtree(self.tmpdir)

          except:  # noqa

no initial comment

rebased onto dfa2ee9

3 years ago

Pull-Request has been merged by julian8628

3 years ago