#380 Fix Compose.result_repofile_path.
Merged 3 years ago by lsedlar. Opened 3 years ago by jkaluza.
jkaluza/odcs watch-logs  into  master

file modified
+1 -1
@@ -302,7 +302,7 @@ 

          """

          Returns path to .repo file.

          """

-         return os.path.join(self.name, "compose", "Temporary",

+         return os.path.join(self.toplevel_dir, "compose", "Temporary",

                              self.name + ".repo")

  

      @property

@@ -20,6 +20,7 @@ 

  #

  # Written by Jan Kaluza <jkaluza@redhat.com>

  

+ import os

  from datetime import datetime

  from datetime import timedelta

  
@@ -84,6 +85,21 @@ 

                           'toplevel_url': 'http://localhost/odcs/odcs-1'}

          self.assertEqual(c.json(True), expected_json)

  

+     def test_compose_paths(self):

+         compose = Compose.create(

+             db.session, "me", PungiSourceType.MODULE, "testmodule-master",

+             COMPOSE_RESULTS["repository"], 3600)

+         compose.id = 1

+         self.assertEqual(compose.toplevel_dir, os.path.join(conf.target_dir, "odcs-1"))

+         self.assertEqual(

+             compose.result_repofile_path,

+             os.path.join(conf.target_dir, "odcs-1/compose/Temporary/odcs-1.repo")

+         )

+         self.assertEqual(

+             compose.result_repo_dir,

+             os.path.join(conf.target_dir, "odcs-1/compose/Temporary")

+         )

+ 

      def test_target_dir_none(self):

          compose = Compose.create(

              db.session, "me", PungiSourceType.MODULE, "testmodule-master",

I found this during Fedora deployment, but it is not a blocker there, because OSBS works even with this bug and it is the only ODCS user there which could possibly rely on this repo file.

Pull-Request has been merged by lsedlar

3 years ago