File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,19 @@ def test_parse_npm_shrinkwrap(self):
245245 packages = npm .parse (test_file )
246246 self .check_packages (packages , expected_loc , regen = False )
247247
248+ def test_parse_with_name (self ):
249+ test_file = self .get_test_loc ('npm/with_name/package.json' )
250+ expected_loc = self .get_test_loc ('npm/with_name/package.json.expected' )
251+ packages = npm .parse (test_file )
252+ self .check_packages (packages , expected_loc , regen = False )
253+
254+ def test_parse_without_name (self ):
255+ test_file = self .get_test_loc ('npm/without_name/package.json' )
256+ try :
257+ npm .parse (test_file )
258+ except AttributeError as e :
259+ assert "'NoneType' object has no attribute 'to_dict'" in str (e )
260+
248261 def test_parse_yarn_lock (self ):
249262 test_file = self .get_test_loc ('npm/yarn-lock/yarn.lock' )
250263 expected_loc = self .get_test_loc (
You can’t perform that action at this time.
0 commit comments