MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / testUploadAssetFromMemory

Method testUploadAssetFromMemory

tests/GitRelease.py:282–297  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

280 self.tearDownNewRelease()
281
282 def testUploadAssetFromMemory(self):
283 self.setUpNewRelease()
284 release = self.new_release
285 content_size = os.path.getsize(self.content_path)
286 with open(self.content_path, "rb") as f:
287 release.upload_asset_from_memory(
288 f,
289 content_size,
290 name="file_name",
291 content_type="text/plain",
292 label="unit test artifact",
293 )
294 asset_list = [x for x in release.get_assets()]
295 self.assertTrue(asset_list is not None)
296 self.assertEqual(len(asset_list), 1)
297 self.tearDownNewRelease()
298
299 def testUploadAssetFileLike(self):
300 self.setUpNewRelease()

Callers

nothing calls this directly

Calls 4

setUpNewReleaseMethod · 0.95
tearDownNewReleaseMethod · 0.95
get_assetsMethod · 0.80

Tested by

no test coverage detected