diff options
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 3eaaa83620..6dda0d3813 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -3112,6 +3112,32 @@ class NPMTest(FetcherTest): | |||
3112 | fetcher.download() | 3112 | fetcher.download() |
3113 | self.assertTrue(os.path.exists(ud.localpath)) | 3113 | self.assertTrue(os.path.exists(ud.localpath)) |
3114 | 3114 | ||
3115 | @skipIfNoNetwork() | ||
3116 | def test_npmsw_bundled(self): | ||
3117 | for packages_key, package_prefix, bundled_key in [ | ||
3118 | ('dependencies', '', 'bundled'), | ||
3119 | ('packages', 'node_modules/', 'inBundle') | ||
3120 | ]: | ||
3121 | swfile = self.create_shrinkwrap_file({ | ||
3122 | packages_key: { | ||
3123 | package_prefix + 'array-flatten': { | ||
3124 | 'version': '1.1.1', | ||
3125 | 'resolved': 'https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz', | ||
3126 | 'integrity': 'sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=' | ||
3127 | }, | ||
3128 | package_prefix + 'content-type': { | ||
3129 | 'version': '1.0.4', | ||
3130 | 'resolved': 'https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz', | ||
3131 | 'integrity': 'sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==', | ||
3132 | bundled_key: True | ||
3133 | } | ||
3134 | } | ||
3135 | }) | ||
3136 | fetcher = bb.fetch.Fetch(['npmsw://' + swfile], self.d) | ||
3137 | fetcher.download() | ||
3138 | self.assertTrue(os.path.exists(os.path.join(self.dldir, 'npm2', 'array-flatten-1.1.1.tgz'))) | ||
3139 | self.assertFalse(os.path.exists(os.path.join(self.dldir, 'npm2', 'content-type-1.0.4.tgz'))) | ||
3140 | |||
3115 | class GitSharedTest(FetcherTest): | 3141 | class GitSharedTest(FetcherTest): |
3116 | def setUp(self): | 3142 | def setUp(self): |
3117 | super(GitSharedTest, self).setUp() | 3143 | super(GitSharedTest, self).setUp() |