bitbake: tests: fetch: adapt npmsw tests to fixed unpack behavior

Adapt the npmsw tests to commit 84f102954e10 ("fetch/npmsw: The fetcher
shouldn't have any knowledge of S").

(Bitbake rev: 8194178291d9b47efb2079fe81b704ba6171efc1)

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Stefan Herbrechtsmeier
2024-12-09 11:31:55 +01:00
committed by Richard Purdie
parent 465872544e
commit 243f9ea060

View File

@@ -2838,9 +2838,6 @@ class NPMTest(FetcherTest):
bb.utils.mkdirhier(datadir)
with open(swfile, 'w') as f:
json.dump(data, f)
# Also configure the S directory
self.sdir = os.path.join(self.unpackdir, 'S')
self.d.setVar('S', self.sdir)
return swfile
@skipIfNoNpm()
@@ -2873,10 +2870,10 @@ class NPMTest(FetcherTest):
self.assertTrue(os.path.exists(os.path.join(self.dldir, 'npm2', 'content-type-1.0.4.tgz')))
self.assertTrue(os.path.exists(os.path.join(self.dldir, 'git2', 'github.com.jshttp.cookie.git')))
fetcher.unpack(self.unpackdir)
self.assertTrue(os.path.exists(os.path.join(self.sdir, 'npm-shrinkwrap.json')))
self.assertTrue(os.path.exists(os.path.join(self.sdir, 'node_modules', 'array-flatten', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.sdir, 'node_modules', 'array-flatten', 'node_modules', 'content-type', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.sdir, 'node_modules', 'array-flatten', 'node_modules', 'content-type', 'node_modules', 'cookie', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'npm-shrinkwrap.json')))
self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'node_modules', 'array-flatten', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'node_modules', 'array-flatten', 'node_modules', 'content-type', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'node_modules', 'array-flatten', 'node_modules', 'content-type', 'node_modules', 'cookie', 'package.json')))
@skipIfNoNpm()
@skipIfNoNetwork()
@@ -2999,7 +2996,7 @@ class NPMTest(FetcherTest):
fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d)
fetcher.download()
fetcher.unpack(self.unpackdir)
self.assertTrue(os.path.exists(os.path.join(self.sdir, 'node_modules', 'array-flatten', 'package.json')))
self.assertTrue(os.path.exists(os.path.join(self.unpackdir, 'node_modules', 'array-flatten', 'package.json')))
@skipIfNoNpm()
@skipIfNoNetwork()