diff options
| author | Danilo M. <danix@danix.xyz> | 2026-10-20 12:12:40 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-10-20 12:12:40 +0200 |
| commit | c8306d6c87a40bb800241cccd90831e3893550b5 (patch) | |
| tree | 1c3b921fb6d416e633e7d42fe777921ff6f65b9a /tests | |
| parent | 6bff3d035d9c1bccacb3fff39d8ef92e9f839748 (diff) | |
| download | sb-builder-c8306d6c87a40bb800241cccd90831e3893550b5.tar.gz sb-builder-c8306d6c87a40bb800241cccd90831e3893550b5.zip | |
sbb-remote 0.6.0: hint-new takes several packages, no version
Each gets the .info pin; Update selected sets a version later. One
package that already has a hint refuses the whole job before it starts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_remote.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/test_remote.py b/tests/test_remote.py index 14622b8..54c5614 100644 --- a/tests/test_remote.py +++ b/tests/test_remote.py @@ -331,7 +331,8 @@ class HintJobsTest(Base): me = [sys.executable, os.path.abspath(sbb.__file__), "_hint"] self.assertEqual(sbb.KINDS["hint-update"](self.cfg, ["x=2.0", "--no-dl"]), (me + ["hint-update", "x=2.0", "--no-dl"], {})) - self.assertEqual(sbb.KINDS["hint-new"](self.cfg, ["x", "2.0"]), (me + ["hint-new", "x", "2.0"], {})) + self.make_pkg("misc/y", self.info) + self.assertEqual(sbb.KINDS["hint-new"](self.cfg, ["x", "y"]), (me + ["hint-new", "x", "y"], {})) self.assertFalse(sbb.signs("hint-update", ["x=2.0"])) def test_kinds_reject(self): @@ -351,14 +352,14 @@ class HintJobsTest(Base): ("hint-update", ["neovim=1"], "bundled deps"), ("hint-update", ["shadowed=1"], "not managed"), ("hint-new", [], "hint-new <pkg>"), - ("hint-new", ["x", "1", "2"], "hint-new <pkg>"), - ("hint-new", ["neovim", "1"], "bundled deps")): + ("hint-new", ["x", "2.0"], "no such package: 2.0"), # no version any more + ("hint-new", ["x", "x"], "twice")): with self.subTest(kind=kind, args=args), self.assertRaisesRegex(sbb.Error, why): sbb.KINDS[kind](self.cfg, args) sbb.KINDS["hint-new"](self.cfg, ["neovim"]) # no version: no bundled deps to touch self.make_pkg("misc/y", self.info, hint="") - with self.assertRaisesRegex(sbb.Error, "exists"): - sbb.KINDS["hint-new"](self.cfg, ["y"]) + with self.assertRaisesRegex(sbb.Error, "y: hint exists"): + sbb.KINDS["hint-new"](self.cfg, ["x", "y"]) # one with a hint refuses the whole job def test_update_backs_up_and_reports(self): self.make_pkg("misc/x", self.info, hint='DELREQUIRES="rust-opt"\n') @@ -388,8 +389,9 @@ class HintJobsTest(Base): def test_new(self): self.make_pkg("misc/x", self.info) - rc, result, _ = self.run_hint("hint-new", "x") - self.assertEqual((rc, result), (0, {"ok": ["x"], "failed": []})) + self.make_pkg("misc/y", self.info) + rc, result, _ = self.run_hint("hint-new", "x", "y") + self.assertEqual((rc, result), (0, {"ok": ["x", "y"], "failed": []})) self.assertIn('#REQUIRES="rust-opt a"', self.read(self.hint)) self.assertIn('MD5SUM="old"', self.read(self.hint)) # no version given: no download |
