diff mbox series

[RFC,12/21] tests: fetch: move npmsw test cases into npmsw test class

Message ID 20241220112613.22647-13-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series Concept for tightly coupled package manager (Node.js, Go, Rust) | expand

Commit Message

Stefan Herbrechtsmeier Dec. 20, 2024, 11:26 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---

 lib/bb/tests/fetch.py | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 934b96cac..3fd4c82cd 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -2831,6 +2831,13 @@  class NPMTest(FetcherTest):
         with self.assertRaises(bb.fetch2.MissingParameterError):
             fetcher = bb.fetch.Fetch(urls, self.d)
 
+class NPMSWTest(FetcherTest):
+    def skipIfNoNpm():
+        import shutil
+        if not shutil.which("npm"):
+            return unittest.skip("npm not installed")
+        return lambda f: f
+
     def create_shrinkwrap_file(self, data):
         import json
         datadir = os.path.join(self.tempdir, "data")