Store API URL in the revision table

Will be important once we get into SLE
This commit is contained in:
Stephan Kulow
2022-11-06 10:57:32 +01:00
parent f1457e8f8e
commit 5ae02a413d
7 changed files with 31 additions and 17 deletions

View File

@@ -6,11 +6,14 @@ from lib.db_revision import DBRevision
from lib.obs import OBS
from lib.obs_revision import OBSRevision
# needs to exist in local oscrc (little tricky)
API_URL = "https://api.opensuse.org"
class TestDBMethods(unittest.TestCase):
def setUp(self):
self.db = DB(section="test")
self.obs = OBS()
self.obs = OBS(API_URL)
def test_import(self):
test_rev = OBSRevision(self.obs, "openSUSE:Factory", "xz")
@@ -30,6 +33,7 @@ class TestDBMethods(unittest.TestCase):
db_rev = DBRevision.fetch_revision(
self.db, project="openSUSE:Factory", package="xz", rev="70"
)
self.assertEqual(db_rev.api_url, API_URL)
self.assertEqual(str(test_rev), str(db_rev))