fix(oci): count only paths added by hand in the Modify menu

- Leave the application's own volumes out of the Extra paths count
- Add a regression test for the count
This commit is contained in:
MacRimi
2026-10-17 21:21:30 +02:00
parent 7d17220294
commit 2c8ebcaa9f
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -147,6 +147,13 @@ class ModifyMenuTests(unittest.TestCase):
recreation.edit_recreation(record(), ui)
self.assertNotIn('private-test-secret', json.dumps(ui.events))
def test_extra_paths_counts_only_paths_added_by_hand(self, _language):
candidate = record()
self.assertTrue(dict(recreation.modification_options(candidate))['paths'].rstrip().endswith(' 0'))
candidate['deployment']['mounts'].append({'container_path': '/media-extra', 'type': 'host-bind',
'source': '/mnt/media', 'custom': True})
self.assertTrue(dict(recreation.modification_options(candidate))['paths'].rstrip().endswith(' 1'))
def test_optional_categories_follow_the_application_profile(self, _language):
candidate = record()
options = dict(recreation.modification_options(candidate))