1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-05 07:03:38 +02:00

Fix handling empty vm_type in Store.last_buildroot

This commit is contained in:
2023-09-25 10:16:00 +02:00
parent 4b5534b070
commit 93cfb76a46
3 changed files with 17 additions and 1 deletions

View File

@@ -36,6 +36,14 @@ class TestGitStore(unittest.TestCase):
store = GitStore(self.tmpdir)
self.assertEqual(store.last_buildroot, ("repo", "arch", "vm_type"))
def test_last_buildroot_empty_vm_type(self):
store = GitStore(self.tmpdir)
self.assertEqual(store.last_buildroot, None)
store.last_buildroot = ("repo", "arch", None)
store = GitStore(self.tmpdir)
self.assertEqual(store.last_buildroot, ("repo", "arch", None))
def test_scmurl(self):
store = GitStore(self.tmpdir)
self.assertEqual(store.scmurl, "https://example.com/packages/my-package.git")

View File

@@ -203,6 +203,12 @@ class TestStore(unittest.TestCase):
store2 = Store(self.tmpdir)
self.assertEqual(store2.last_buildroot, ["repo", "arch", "vm_type"])
self.store.last_buildroot = "repo", "arch", None
self.fileEquals("_last_buildroot", "repo\narch\n\n")
store2 = Store(self.tmpdir)
self.assertEqual(store2.last_buildroot, ["repo", "arch", None])
def test_meta_node(self):
self.store.write_string(
"_meta",