MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / upload_file

Method upload_file

seleniumbase/core/s3_manager.py:46–61  ·  view source on GitHub ↗

Upload a given file from the file_path to the bucket with the new name/path file_name.

(self, file_name, file_path)

Source from the content-addressed store, hash-verified

44 return self.bucket
45
46 def upload_file(self, file_name, file_path):
47 """Upload a given file from the file_path to the bucket
48 with the new name/path file_name."""
49 upload_key = self.get_key(file_name)
50 content_type = "text/plain"
51 if file_name.endswith(".html"):
52 content_type = "text/html"
53 elif file_name.endswith(".jpg"):
54 content_type = "image/jpeg"
55 elif file_name.endswith(".png"):
56 content_type = "image/png"
57 upload_key.Bucket().upload_file(
58 file_path,
59 file_name,
60 ExtraArgs={"ACL": "public-read", "ContentType": content_type},
61 )
62
63 def upload_index_file(
64 self, test_address, timestamp, data_path, save_data_to_logs

Callers 3

afterTestMethod · 0.95
tearDownMethod · 0.95
upload_index_fileMethod · 0.80

Calls 1

get_keyMethod · 0.95

Tested by

no test coverage detected