Merge ~jslarraz/review-tools:run-black into review-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: d438d79718c3412236809685c25bdb086472b426
Proposed branch: ~jslarraz/review-tools:run-black
Merge into: review-tools:master
Diff against target: 380 lines (+69/-37)
13 files modified
reviewtools/modules.py (+1/-0)
reviewtools/overrides.py (+1/-1)
reviewtools/sr_common.py (+5/-3)
reviewtools/sr_functional.py (+1/-1)
reviewtools/sr_lint.py (+2/-1)
reviewtools/sr_security.py (+9/-5)
reviewtools/tests/test_debversion.py (+1/-1)
reviewtools/tests/test_email.py (+2/-2)
reviewtools/tests/test_sr_declaration.py (+0/-3)
reviewtools/tests/test_sr_functional.py (+4/-4)
reviewtools/tests/test_sr_lint.py (+26/-10)
reviewtools/tests/test_sr_security.py (+1/-1)
reviewtools/tests/test_store.py (+16/-5)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+465415@code.launchpad.net

Commit message

As discussed we want to start enforcing black format in review-tools. This PR should only include format changes to adopt meet black format.

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM - as seen in the lpci test log:

:: ./run-black
:: = black =
:: Checking ./reviewtools/__init__.py
:: Checking ./reviewtools/available.py
:: Checking ./reviewtools/common.py
:: Checking ./reviewtools/debversion.py
:: Checking ./reviewtools/email.py
:: Checking ./reviewtools/modules.py
:: Checking ./reviewtools/overrides.py
:: Checking ./reviewtools/rr_common.py
:: Checking ./reviewtools/sr_common.py
:: Checking ./reviewtools/sr_declaration.py
:: Checking ./reviewtools/sr_functional.py
:: Checking ./reviewtools/sr_lint.py
:: Checking ./reviewtools/sr_security.py
:: Checking ./reviewtools/sr_skeleton.py
:: Checking ./reviewtools/sr_tests.py
:: Checking ./reviewtools/store.py
:: Checking ./reviewtools/usn.py
:: Checking ./reviewtools/tests/__init__.py
:: Checking ./reviewtools/tests/test_available.py
:: Checking ./reviewtools/tests/test_bbb_example_sr_skeleton.py
:: Checking ./reviewtools/tests/test_common.py
:: Checking ./reviewtools/tests/test_debversion.py
:: Checking ./reviewtools/tests/test_email.py
:: Checking ./reviewtools/tests/test_modules.py
:: Checking ./reviewtools/tests/test_sr_common.py
:: Checking ./reviewtools/tests/test_sr_declaration.py
:: Checking ./reviewtools/tests/test_sr_functional.py
:: Checking ./reviewtools/tests/test_sr_lint.py
:: Checking ./reviewtools/tests/test_sr_security.py
:: Checking ./reviewtools/tests/test_store.py
:: Checking ./reviewtools/tests/test_usn.py
:: Checking ./reviewtools/tests/utils.py
:: Checking ./bin/snap-review
:: Checking ./bin/create-snap-declaration
:: Checking ./bin/dump-tool
:: Checking ./bin/get-base-declaration
:: Checking ./bin/store-query
:: Checking ./bin/rock-updates-available
:: Checking ./bin/snap-updates-available
:: Checking ./bin/snap-check-declaration
:: Checking ./bin/snap-check-lint
:: Checking ./bin/snap-check-security
:: Checking ./bin/snap-check-skeleton
:: Checking ./bin/snap-verify-declaration

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/reviewtools/modules.py b/reviewtools/modules.py
index bd8be66..9b93f32 100644
--- a/reviewtools/modules.py
+++ b/reviewtools/modules.py
@@ -56,6 +56,7 @@ def find_main_class(module_name):
56 fullpath = "%s/%s.py" % (dir, module_name)56 fullpath = "%s/%s.py" % (dir, module_name)
57 if os.path.isfile(fullpath):57 if os.path.isfile(fullpath):
58 import importlib.util58 import importlib.util
59
59 spec = importlib.util.spec_from_file_location(module_name, fullpath)60 spec = importlib.util.spec_from_file_location(module_name, fullpath)
60 if spec is None or spec.loader is None:61 if spec is None or spec.loader is None:
61 continue62 continue
diff --git a/reviewtools/overrides.py b/reviewtools/overrides.py
index a1db622..60d833b 100644
--- a/reviewtools/overrides.py
+++ b/reviewtools/overrides.py
@@ -1271,7 +1271,7 @@ canonical_security = [
1271 "jorge.sancho.larraz@canonical.com",1271 "jorge.sancho.larraz@canonical.com",
1272 "leo.barbosa@canonical.com",1272 "leo.barbosa@canonical.com",
1273 "nishit.majithia@canonical.com",1273 "nishit.majithia@canonical.com",
1274 "paulo.smorigo@canonical.com"1274 "paulo.smorigo@canonical.com",
1275]1275]
12761276
1277canonical_server = ["christian.ehrhardt@canonical.com", "robie.basak@canonical.com"]1277canonical_server = ["christian.ehrhardt@canonical.com", "robie.basak@canonical.com"]
diff --git a/reviewtools/sr_common.py b/reviewtools/sr_common.py
index 4d33459..201a0dc 100644
--- a/reviewtools/sr_common.py
+++ b/reviewtools/sr_common.py
@@ -286,9 +286,11 @@ class SnapReview(Review):
286 "posix-mq/plugs": "",286 "posix-mq/plugs": "",
287 },287 },
288 "pwm": {"chip-number/slots": 0, "channel/slots": 0},288 "pwm": {"chip-number/slots": 0, "channel/slots": 0},
289 "qualcomm-ipc-router": {"address/slots": "",289 "qualcomm-ipc-router": {
290 "qcipc/plugs": "",290 "address/slots": "",
291 "qcipc/slots": ""},291 "qcipc/plugs": "",
292 "qcipc/slots": "",
293 },
292 "raw-volume": {"path/slots": ""},294 "raw-volume": {"path/slots": ""},
293 "sd-control": {"flavor/plugs": ""},295 "sd-control": {"flavor/plugs": ""},
294 "serial-port": {296 "serial-port": {
diff --git a/reviewtools/sr_functional.py b/reviewtools/sr_functional.py
index 6ec2300..bbdc56b 100644
--- a/reviewtools/sr_functional.py
+++ b/reviewtools/sr_functional.py
@@ -62,7 +62,7 @@ class SnapReviewFunctional(SnapReview):
6262
63 # read in current state63 # read in current state
64 self.curr_state = {}64 self.curr_state = {}
65 for (line, item) in self.unsquashfs_lln_entries:65 for line, item in self.unsquashfs_lln_entries:
66 if item is None:66 if item is None:
67 continue67 continue
6868
diff --git a/reviewtools/sr_lint.py b/reviewtools/sr_lint.py
index d8cdca4..c94340a 100644
--- a/reviewtools/sr_lint.py
+++ b/reviewtools/sr_lint.py
@@ -3295,7 +3295,8 @@ class SnapReviewLint(SnapReview):
3295 def check_mpris_slot_name(self):3295 def check_mpris_slot_name(self):
3296 """Check mpris slot name attribute is valid3296 """Check mpris slot name attribute is valid
32973297
3298 https://github.com/snapcore/snapd/blob/55909123bcf261d11c9714b9245e9307f64f6891/interfaces/builtin/mpris.go#L215"""3298 https://github.com/snapcore/snapd/blob/55909123bcf261d11c9714b9245e9307f64f6891/interfaces/builtin/mpris.go#L215
3299 """
3299 if "slots" not in self.snap_yaml:3300 if "slots" not in self.snap_yaml:
3300 return3301 return
33013302
diff --git a/reviewtools/sr_security.py b/reviewtools/sr_security.py
index 27f2ea8..5353208 100644
--- a/reviewtools/sr_security.py
+++ b/reviewtools/sr_security.py
@@ -179,7 +179,10 @@ class SnapReviewSecurity(SnapReview):
179179
180 orig_stat = os.stat(orig)180 orig_stat = os.stat(orig)
181 resq_stat = os.stat(resq)181 resq_stat = os.stat(resq)
182 debug_output += "\norig size: %d\nresq_size: %d" % (orig_stat.st_size, resq_stat.st_size)182 debug_output += "\norig size: %d\nresq_size: %d" % (
183 orig_stat.st_size,
184 resq_stat.st_size,
185 )
183186
184 return debug_output187 return debug_output
185188
@@ -376,8 +379,9 @@ class SnapReviewSecurity(SnapReview):
376 # If repacked package is smaller then original one, that means it's379 # If repacked package is smaller then original one, that means it's
377 # truncated with the minimum size.380 # truncated with the minimum size.
378 if os.stat(fn).st_size == SNAP_MINIMUM_SIZE and (381 if os.stat(fn).st_size == SNAP_MINIMUM_SIZE and (
379 os.stat(tmp_repack).st_size < os.stat(fn).st_size):382 os.stat(tmp_repack).st_size < os.stat(fn).st_size
380 with open(tmp_repack, 'ab') as f:383 ):
384 with open(tmp_repack, "ab") as f:
381 f.truncate(SNAP_MINIMUM_SIZE)385 f.truncate(SNAP_MINIMUM_SIZE)
382386
383 (rc, out) = cmd(["sha512sum", tmp_repack])387 (rc, out) = cmd(["sha512sum", tmp_repack])
@@ -537,7 +541,7 @@ class SnapReviewSecurity(SnapReview):
537 readdir_pat = re.compile(r"^r.xr.xr.x")541 readdir_pat = re.compile(r"^r.xr.xr.x")
538 errors = []542 errors = []
539543
540 for (line, item) in self.unsquashfs_lln_entries:544 for line, item in self.unsquashfs_lln_entries:
541 if item is None:545 if item is None:
542 continue546 continue
543547
@@ -621,7 +625,7 @@ class SnapReviewSecurity(SnapReview):
621 if ref in self.base_declaration["slots"]:625 if ref in self.base_declaration["slots"]:
622 ok = False626 ok = False
623 if pkgname in sec_iface_ref_matches_base_decl_overrides:627 if pkgname in sec_iface_ref_matches_base_decl_overrides:
624 for (aIface, aRef) in sec_iface_ref_matches_base_decl_overrides[628 for aIface, aRef in sec_iface_ref_matches_base_decl_overrides[
625 pkgname629 pkgname
626 ]:630 ]:
627 if (631 if (
diff --git a/reviewtools/tests/test_debversion.py b/reviewtools/tests/test_debversion.py
index 406c72e..f5190ec 100644
--- a/reviewtools/tests/test_debversion.py
+++ b/reviewtools/tests/test_debversion.py
@@ -81,7 +81,7 @@ class TestDebVersion(TestCase):
81 ),81 ),
82 ]82 ]
83 print("")83 print("")
84 for (av, bv, expected) in versions:84 for av, bv, expected in versions:
85 print(" checking compare(%s, %s) == %d" % (av, bv, expected))85 print(" checking compare(%s, %s) == %d" % (av, bv, expected))
86 a = DebVersion(av)86 a = DebVersion(av)
87 b = DebVersion(bv)87 b = DebVersion(bv)
diff --git a/reviewtools/tests/test_email.py b/reviewtools/tests/test_email.py
index f665bc5..fa2e30f 100644
--- a/reviewtools/tests/test_email.py
+++ b/reviewtools/tests/test_email.py
@@ -28,7 +28,7 @@ class TestEmail(TestCase):
28 ("Foo Bar <foo.bar@example.com>", "foo.bar@example.com"),28 ("Foo Bar <foo.bar@example.com>", "foo.bar@example.com"),
29 ("snaps@canonical.com", "snaps@canonical.com"),29 ("snaps@canonical.com", "snaps@canonical.com"),
30 ]30 ]
31 for (addr, expected) in addresses:31 for addr, expected in addresses:
32 self.assertEqual(sanitize_addr(addr), expected)32 self.assertEqual(sanitize_addr(addr), expected)
3333
34 def test_check_sanitize_addr_invalid(self):34 def test_check_sanitize_addr_invalid(self):
@@ -40,5 +40,5 @@ class TestEmail(TestCase):
40 ("@foo.bar", ""),40 ("@foo.bar", ""),
41 ("foo@@bar", ""),41 ("foo@@bar", ""),
42 ]42 ]
43 for (addr, expected) in addresses:43 for addr, expected in addresses:
44 self.assertEqual(sanitize_addr(addr), expected)44 self.assertEqual(sanitize_addr(addr), expected)
diff --git a/reviewtools/tests/test_sr_declaration.py b/reviewtools/tests/test_sr_declaration.py
index cef3967..3d58737 100644
--- a/reviewtools/tests/test_sr_declaration.py
+++ b/reviewtools/tests/test_sr_declaration.py
@@ -7729,7 +7729,6 @@ slots:
7729 ],7729 ],
7730 ),7730 ),
7731 ]:7731 ]:
7732
7733 self.set_test_snap_yaml("plugs", plugs)7732 self.set_test_snap_yaml("plugs", plugs)
7734 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}7733 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}
7735 c = SnapReviewDeclaration(self.test_name, overrides=overrides)7734 c = SnapReviewDeclaration(self.test_name, overrides=overrides)
@@ -7835,7 +7834,6 @@ slots:
7835 ],7834 ],
7836 ),7835 ),
7837 ]:7836 ]:
7838
7839 self.set_test_snap_yaml("plugs", plugs)7837 self.set_test_snap_yaml("plugs", plugs)
7840 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}7838 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}
7841 c = SnapReviewDeclaration(self.test_name, overrides=overrides)7839 c = SnapReviewDeclaration(self.test_name, overrides=overrides)
@@ -7911,7 +7909,6 @@ slots:
7911 ],7909 ],
7912 ),7910 ),
7913 ]:7911 ]:
7914
7915 self.set_test_snap_yaml("plugs", plugs)7912 self.set_test_snap_yaml("plugs", plugs)
7916 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}7913 overrides = {"snap_decl_plugs": {"iface": {"%s" % (cstr): overrides}}}
7917 c = SnapReviewDeclaration(self.test_name, overrides=overrides)7914 c = SnapReviewDeclaration(self.test_name, overrides=overrides)
diff --git a/reviewtools/tests/test_sr_functional.py b/reviewtools/tests/test_sr_functional.py
index ebd760e..8b97757 100644
--- a/reviewtools/tests/test_sr_functional.py
+++ b/reviewtools/tests/test_sr_functional.py
@@ -284,7 +284,7 @@ crw-rw-rw- 0/0 1, 3 2020-03-14 18:21 squashfs-root/dev/null
284 hdr, entries = unsquashfs_lln_parse(lln)284 hdr, entries = unsquashfs_lln_parse(lln)
285285
286 state = {}286 state = {}
287 for (line, item) in entries:287 for line, item in entries:
288 state[item[StatLLN.FILENAME]] = item288 state[item[StatLLN.FILENAME]] = item
289 if "libc-2.31.so" in line:289 if "libc-2.31.so" in line:
290 state[item[StatLLN.FILENAME]]["symbols"] = {290 state[item[StatLLN.FILENAME]]["symbols"] = {
@@ -297,7 +297,7 @@ crw-rw-rw- 0/0 1, 3 2020-03-14 18:21 squashfs-root/dev/null
297297
298 self.assertEqual(len(entries), len(serial))298 self.assertEqual(len(entries), len(serial))
299 self.assertEqual(len(serial), 7)299 self.assertEqual(len(serial), 7)
300 for (idx, map) in [300 for idx, map in [
301 (".", {"filetype": "d", "mode": "rwxr-xr-x", "owner": "0/0"}),301 (".", {"filetype": "d", "mode": "rwxr-xr-x", "owner": "0/0"}),
302 ("./bin", {"filetype": "d", "mode": "rwxr-xr-x", "owner": "0/0"}),302 ("./bin", {"filetype": "d", "mode": "rwxr-xr-x", "owner": "0/0"}),
303 ("./bin/cat", {"filetype": "-", "mode": "rwxr-xr-x", "owner": "0/0"}),303 ("./bin/cat", {"filetype": "-", "mode": "rwxr-xr-x", "owner": "0/0"}),
@@ -378,7 +378,7 @@ crw-rw-rw- 0/0 1, 3 2020-03-14 18:21 squashfs-root/dev/null
378 c = SnapReviewFunctional(self.test_name)378 c = SnapReviewFunctional(self.test_name)
379379
380 state = {}380 state = {}
381 for (line, item) in entries:381 for line, item in entries:
382 state[item[StatLLN.FILENAME]] = item382 state[item[StatLLN.FILENAME]] = item
383383
384 serial = c._serialize(state)384 serial = c._serialize(state)
@@ -451,7 +451,7 @@ crw-rw-rw- 0/0 1, 3 2020-03-14 18:21 squashfs-root/dev/null
451 self.assertEqual(len(state), len(entries))451 self.assertEqual(len(state), len(entries))
452 self.assertEqual(len(state), 7)452 self.assertEqual(len(state), 7)
453453
454 for (idx, item) in [454 for idx, item in [
455 (455 (
456 ".",456 ".",
457 {457 {
diff --git a/reviewtools/tests/test_sr_lint.py b/reviewtools/tests/test_sr_lint.py
index 692e77e..46f141c 100644
--- a/reviewtools/tests/test_sr_lint.py
+++ b/reviewtools/tests/test_sr_lint.py
@@ -1000,7 +1000,9 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
1000 def test_check_link_with_tilde(self):1000 def test_check_link_with_tilde(self):
1001 """Test check_link"""1001 """Test check_link"""
1002 links = {1002 links = {
1003 "source-code": ["https://code.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/+ref/stable"],1003 "source-code": [
1004 "https://code.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/+ref/stable"
1005 ],
1004 }1006 }
1005 self.set_test_snap_yaml("links", links)1007 self.set_test_snap_yaml("links", links)
1006 c = SnapReviewLint(self.test_name)1008 c = SnapReviewLint(self.test_name)
@@ -4753,7 +4755,7 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
4753 "lint-snap-v2:base_valid": {4755 "lint-snap-v2:base_valid": {
4754 "text": "(NEEDS REVIEW) snap grade (stable) does not match base grade (stable)"4756 "text": "(NEEDS REVIEW) snap grade (stable) does not match base grade (stable)"
4755 }4757 }
4756 }4758 },
4757 }4759 }
4758 self.check_results(r, expected=expected)4760 self.check_results(r, expected=expected)
4759 name = c._get_check_name("base_valid")4761 name = c._get_check_name("base_valid")
@@ -5071,7 +5073,9 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5071 expected_counts = {"info": 2, "warn": 0, "error": 0}5073 expected_counts = {"info": 2, "warn": 0, "error": 0}
5072 self.check_results(r, expected_counts)5074 self.check_results(r, expected_counts)
50735075
5074 def test_check_sockets_invalid_listen_stream_snap_user_data_without_user_daemon_scope(self):5076 def test_check_sockets_invalid_listen_stream_snap_user_data_without_user_daemon_scope(
5077 self,
5078 ):
5075 """Test check_apps_sockets() - invalid listen-stream SNAP_USER_DATA without user daemon-scope"""5079 """Test check_apps_sockets() - invalid listen-stream SNAP_USER_DATA without user daemon-scope"""
5076 self.set_test_snap_yaml(5080 self.set_test_snap_yaml(
5077 "apps",5081 "apps",
@@ -5088,8 +5092,12 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5088 """Test check_apps_sockets() - valid listen-stream SNAP_USER_DATA with user daemon-scope"""5092 """Test check_apps_sockets() - valid listen-stream SNAP_USER_DATA with user daemon-scope"""
5089 self.set_test_snap_yaml(5093 self.set_test_snap_yaml(
5090 "apps",5094 "apps",
5091 {"foo": {"sockets": {"sock1": {"listen-stream": "$SNAP_USER_DATA/sock"}},5095 {
5092 "daemon-scope": "user"}},5096 "foo": {
5097 "sockets": {"sock1": {"listen-stream": "$SNAP_USER_DATA/sock"}},
5098 "daemon-scope": "user",
5099 }
5100 },
5093 )5101 )
50945102
5095 c = SnapReviewLint(self.test_name)5103 c = SnapReviewLint(self.test_name)
@@ -5102,8 +5110,12 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5102 """Test check_apps_sockets() - valid listen-stream SNAP_USER_COMMON with user daemon-scope"""5110 """Test check_apps_sockets() - valid listen-stream SNAP_USER_COMMON with user daemon-scope"""
5103 self.set_test_snap_yaml(5111 self.set_test_snap_yaml(
5104 "apps",5112 "apps",
5105 {"foo": {"sockets": {"sock1": {"listen-stream": "$SNAP_USER_COMMON/sock"}},5113 {
5106 "daemon-scope": "user"}},5114 "foo": {
5115 "sockets": {"sock1": {"listen-stream": "$SNAP_USER_COMMON/sock"}},
5116 "daemon-scope": "user",
5117 }
5118 },
5107 )5119 )
51085120
5109 c = SnapReviewLint(self.test_name)5121 c = SnapReviewLint(self.test_name)
@@ -5116,8 +5128,12 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
5116 """Test check_apps_sockets() - valid listen-stream XDG_RUNTIME_DIR with user daemon-scope"""5128 """Test check_apps_sockets() - valid listen-stream XDG_RUNTIME_DIR with user daemon-scope"""
5117 self.set_test_snap_yaml(5129 self.set_test_snap_yaml(
5118 "apps",5130 "apps",
5119 {"foo": {"sockets": {"sock1": {"listen-stream": "$XDG_RUNTIME_DIR/sock"}},5131 {
5120 "daemon-scope": "user"}},5132 "foo": {
5133 "sockets": {"sock1": {"listen-stream": "$XDG_RUNTIME_DIR/sock"}},
5134 "daemon-scope": "user",
5135 }
5136 },
5121 )5137 )
51225138
5123 c = SnapReviewLint(self.test_name)5139 c = SnapReviewLint(self.test_name)
@@ -6517,7 +6533,7 @@ class TestSnapReviewLint(sr_tests.TestSnapReview):
6517 ("snap.foo.bar.ico", None),6533 ("snap.foo.bar.ico", None),
6518 ("snap.foo.bar", None),6534 ("snap.foo.bar", None),
6519 ]6535 ]
6520 for (fn, exreal) in valid:6536 for fn, exreal in valid:
6521 valid, real_fn = c._verify_icon_path(fn)6537 valid, real_fn = c._verify_icon_path(fn)
6522 self.assertTrue(valid)6538 self.assertTrue(valid)
6523 self.assertEqual(real_fn, exreal)6539 self.assertEqual(real_fn, exreal)
diff --git a/reviewtools/tests/test_sr_security.py b/reviewtools/tests/test_sr_security.py
index 9989747..de1cc44 100644
--- a/reviewtools/tests/test_sr_security.py
+++ b/reviewtools/tests/test_sr_security.py
@@ -1071,7 +1071,7 @@ slots:
1071 (pkg, "/test", "rwxrwxrwt", {"/test": "rwxrwxrwt"}, True),1071 (pkg, "/test", "rwxrwxrwt", {"/test": "rwxrwxrwt"}, True),
1072 (pkg, "/test", "rwxrwxrwt", {"/test": ["rwxrwxrwT", "rwxrwxrwt"]}, True),1072 (pkg, "/test", "rwxrwxrwt", {"/test": ["rwxrwxrwT", "rwxrwxrwt"]}, True),
1073 ]1073 ]
1074 for (p, f, m, override, exp) in tests:1074 for p, f, m, override, exp in tests:
1075 if p is not None:1075 if p is not None:
1076 sec_mode_overrides[p] = override1076 sec_mode_overrides[p] = override
1077 c = SnapReviewSecurity(self.test_name)1077 c = SnapReviewSecurity(self.test_name)
diff --git a/reviewtools/tests/test_store.py b/reviewtools/tests/test_store.py
index cd6c3d1..5c1b8cd 100644
--- a/reviewtools/tests/test_store.py
+++ b/reviewtools/tests/test_store.py
@@ -594,7 +594,8 @@ class TestStore(TestCase):
594 self,594 self,
595 ):595 ):
596 """Test get_package_revisions() - parts/stage-packages and596 """Test get_package_revisions() - parts/stage-packages and
597 primed-stage-packages are None has no security notices if no usn for build-pkgs"""597 primed-stage-packages are None has no security notices if no usn for build-pkgs
598 """
598 for i in range(len(self.store_db[0]["revisions"])):599 for i in range(len(self.store_db[0]["revisions"])):
599 m = yaml.load(600 m = yaml.load(
600 self.store_db[0]["revisions"][i]["manifest_yaml"],601 self.store_db[0]["revisions"][i]["manifest_yaml"],
@@ -1211,7 +1212,12 @@ class TestStore(TestCase):
12111212
1212 def test_check_get_secnots_ignore_pockets(self):1213 def test_check_get_secnots_ignore_pockets(self):
1213 """Test get_secnots_for_manifest() - ignore_pockets"""1214 """Test get_secnots_for_manifest() - ignore_pockets"""
1214 for ignore_pockets in [[], ["esm-apps"], ["esm-apps/focal"], ["esm-apps/jammy"]]:1215 for ignore_pockets in [
1216 [],
1217 ["esm-apps"],
1218 ["esm-apps/focal"],
1219 ["esm-apps/jammy"],
1220 ]:
1215 m = yaml.load(1221 m = yaml.load(
1216 self.store_esm_apps_db[0]["revisions"][0]["manifest_yaml"],1222 self.store_esm_apps_db[0]["revisions"][0]["manifest_yaml"],
1217 Loader=yaml.SafeLoader,1223 Loader=yaml.SafeLoader,
@@ -2174,7 +2180,7 @@ class TestStore(TestCase):
2174 ("4.4.0-161", "4.4.0.161.999999"),2180 ("4.4.0-161", "4.4.0.161.999999"),
2175 ("4.4.0-140-1", "4.4.0.140.999999"),2181 ("4.4.0-140-1", "4.4.0.140.999999"),
2176 ]2182 ]
2177 for (v, expected) in tests:2183 for v, expected in tests:
2178 res = store.convert_canonical_kernel_version(v)2184 res = store.convert_canonical_kernel_version(v)
2179 self.assertEqual(res, expected)2185 self.assertEqual(res, expected)
21802186
@@ -2190,7 +2196,7 @@ class TestStore(TestCase):
2190 ("1.2-3+git1234ubuntu0.1", "1.2-3+git1234ubuntu0.1"),2196 ("1.2-3+git1234ubuntu0.1", "1.2-3+git1234ubuntu0.1"),
2191 ("1.2-3+git1234ubuntu0.1+deadbeef", "1.2-3+git1234ubuntu0.1"),2197 ("1.2-3+git1234ubuntu0.1+deadbeef", "1.2-3+git1234ubuntu0.1"),
2192 ]2198 ]
2193 for (v, expected) in tests:2199 for v, expected in tests:
2194 res = store.convert_canonical_app_version(v)2200 res = store.convert_canonical_app_version(v)
2195 self.assertEqual(res, expected)2201 self.assertEqual(res, expected)
21962202
@@ -2600,7 +2606,12 @@ class TestStore(TestCase):
2600 def test_check_get_package_revisions_ignore_pockets(self):2606 def test_check_get_package_revisions_ignore_pockets(self):
2601 """Test get_package_revisions() - ignore_pockets=esm-apps"""2607 """Test get_package_revisions() - ignore_pockets=esm-apps"""
2602 errors = {}2608 errors = {}
2603 for ignore_pockets in [[], ["esm-apps"], ["esm-apps/focal"], ["esm-apps/jammy"]]:2609 for ignore_pockets in [
2610 [],
2611 ["esm-apps"],
2612 ["esm-apps/focal"],
2613 ["esm-apps/jammy"],
2614 ]:
2604 with self.subTest():2615 with self.subTest():
2605 res = store.get_pkg_revisions(2616 res = store.get_pkg_revisions(
2606 read_file_as_json_dict("./tests/test-store-unittest-esm-apps.db")[2617 read_file_as_json_dict("./tests/test-store-unittest-esm-apps.db")[

Subscribers

People subscribed via source and target branches