MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / check_rubygem

Function check_rubygem

tests/packagedcode/test_rubygems.py:120–133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118
119 # closure on the test params
120 def check_rubygem(self):
121 loc = self.get_test_loc(test_loc)
122 expected_json_loc = loc + '.json'
123 packages = list(rubygems.GemArchiveHandler.parse(location=loc))
124 package = packages[0]
125 package.populate_license_fields()
126 package = [package.to_dict()]
127 if regen:
128 with io.open(expected_json_loc, 'w') as ex:
129 json.dump(package, ex, indent=2)
130
131 with io.open(expected_json_loc, encoding='utf-8') as ex:
132 expected = json.load(ex)
133 assert package == expected
134
135 if isinstance(test_name, bytes):
136 test_name = test_name.decode('utf-8')

Callers

nothing calls this directly

Calls 7

get_test_locMethod · 0.80
parseMethod · 0.45
to_dictMethod · 0.45
openMethod · 0.45
dumpMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected