Skip to content

Commit

Permalink
fix docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
alismx committed Dec 12, 2024
1 parent eecc604 commit 71b1378
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions containers/ecr-viewer/seed-scripts/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ class EcrViewer(HttpUser):

@task
def ecr_viewer(self):
"""get the ecr viewer library page"""
self.client.get(f"/ecr-viewer")

Check failure on line 14 in containers/ecr-viewer/seed-scripts/locustfile.py

View workflow job for this annotation

GitHub Actions / orchestration-python-linting

Ruff (F541)

containers/ecr-viewer/seed-scripts/locustfile.py:14:25: F541 f-string without any placeholders

@task
def orchestration(self):
"""get the orchestration endpoint"""
self.client.get(f"/orchestration")

Check failure on line 19 in containers/ecr-viewer/seed-scripts/locustfile.py

View workflow job for this annotation

GitHub Actions / orchestration-python-linting

Ruff (F541)

containers/ecr-viewer/seed-scripts/locustfile.py:19:25: F541 f-string without any placeholders

@task
def upload_zip(self):
"""upload a zip file to the orchestration endpoint"""
for file in get_zipped_files():
with open(file, "rb") as opened_file:
data = {
Expand All @@ -30,14 +33,14 @@ def upload_zip(self):
file_tuple = { "upload_file": ( file, opened_file.read(), "application/zip") }
response = self.client.post(f"/orchestration/process-zip", data=data, files=file_tuple)

Check failure on line 34 in containers/ecr-viewer/seed-scripts/locustfile.py

View workflow job for this annotation

GitHub Actions / orchestration-python-linting

Ruff (F541)

containers/ecr-viewer/seed-scripts/locustfile.py:34:45: F541 f-string without any placeholders
self.tasks.append(check_ecr(self, file, response.json()))

# Runs at the start of each test. Useful for authentication and setup actions.

def on_start(self):
"""install the requirements"""
subprocess.run(["pip", "install", "-r", "requirements.txt"])
pass

# Check the ecr viewer response for eicr_id and view the ecr
def check_ecr(self, file, response):
"""Check the ecr viewer response for eicr_id and view the ecr"""
if "detail" in response:
print(f"{file}", response['detail'])
if "message" in response:
Expand All @@ -57,8 +60,8 @@ def check_ecr(self, file, response):
else:
print("No eicr_id found in response")

# Get all the zipped files in the baseECR folder
def get_zipped_files():
"""Get all the zipped files in the baseECR folder"""
files = []
BASEDIR = os.path.dirname(os.path.abspath(__file__))
subfolders = ["LA"]
Expand Down

0 comments on commit 71b1378

Please sign in to comment.