MCPcopy Create free account
hub / github.com/aptly-dev/aptly / upload

Method upload

system/api_lib.py:150–165  ·  view source on GitHub ↗
(self, uri, *filenames, **kwargs)

Source from the content-addressed store, hash-verified

148 return self.get("/api/tasks/" + str(_id))
149
150 def upload(self, uri, *filenames, **kwargs):
151 upload_name = kwargs.pop("upload_name", None)
152 directory = kwargs.pop("directory", "files")
153 assert kwargs == {}
154
155 files = {}
156
157 for filename in filenames:
158 fp = open(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), directory, filename), "rb")
159 if upload_name is not None:
160 upload_filename = upload_name
161 else:
162 upload_filename = filename
163 files[upload_filename] = (upload_filename, fp)
164
165 return self.post(uri, files=files)
166
167 @classmethod
168 def shutdown_class(cls):

Callers 15

checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80
checkMethod · 0.80

Calls 1

postMethod · 0.95

Tested by

no test coverage detected