diff mbox series

[RFC,14/15] tests: fetch: add npm mirrors replaceuris in MirrorUriTest

Message ID 20250205071538.2681-14-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series Make mirror replacement syntax explicit | expand

Commit Message

Stefan Herbrechtsmeier Feb. 5, 2025, 7:15 a.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Add replaceuris in MirrorUriTest for a npm upstream and download mirror.

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

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

Patch

diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 37de4d3e8..5d247f6a9 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -544,6 +544,12 @@  class MirrorUriTest(FetcherTest):
         # local mirror for https with subfolder in downloadfilename
         ("https://somewhere.org/example-1.0.0.tgz;downloadfilename=subdir/some-example-1.0.0.tgz", "https://.*/.*", "file:///mirror/sub")
             : "file:///mirror/sub/subdir/some-example-1.0.0.tgz;downloadfilename=subdir/some-example-1.0.0.tgz",
+        # NPM Upstream Mirror
+        ("https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.10.4.tgz;downloadfilename=npm2/@node-rs-bcrypt-1.10.4.tgz", "https://registry.npmjs.org/", "https://example.com/npm/")
+            : "https://example.com/npm/%40node-rs/bcrypt/-/bcrypt-1.10.4.tgz;downloadfilename=npm2/@node-rs-bcrypt-1.10.4.tgz",
+        # NPM Download Mirror
+        ("https://registry.npmjs.org/@node-rs/bcrypt/-/bcrypt-1.10.4.tgz;downloadfilename=npm2/@node-rs-bcrypt-1.10.4.tgz", "https://registry.npmjs.org/.*", "file:///downloads/DOWNLOADFILENAME")
+            : "file:///downloads/npm2/%40node-rs-bcrypt-1.10.4.tgz;downloadfilename=npm2/@node-rs-bcrypt-1.10.4.tgz",
     }
 
     mirrorvar = "http://.*/.* file:///somepath/downloads/ " \