Skip to content

Commit

Permalink
update tests; update headers
Browse files Browse the repository at this point in the history
  • Loading branch information
NawarA committed Jul 31, 2024
1 parent 390314f commit ca9c7d8
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
# Edit the following line to reflect the actual name of the GitHub Secret containing your private key
#ssh: ${{ secrets.BOT_KEY }}
# ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }}
Binary file added python/bytez/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified python/bytez/__pycache__/main.cpython-38.pyc
Binary file not shown.
4 changes: 2 additions & 2 deletions python/bytez/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def __init__(self, api_key):
Args:
api_key (str): Your Bytez API key.
"""
self.auth = {"authorization": f"Key {api_key}"}
self.headers = {"authorization": f"Key {api_key}", "content-type": "application/json" }

def _request(self, path="", body=None, stream=False):
try:
url = "https://api.bytez.com/" + path
headers = {**self.auth, "content-type": "application/json"} if body else self.auth
headers = self.headers
method = "POST" if body else "GET"
data = json.dumps(body) if body else None

Expand Down
2 changes: 1 addition & 1 deletion python/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_list_models(self):

self.assertIsInstance(model_list, list, "should return array of models")
self.assertNotEqual(len(model_list), 0, "array is not empty")
self.assertTrue(all('name' in model and 'requiredRamGB' in model for model in model_list),
self.assertTrue(all('modelId' in model and 'ramRequired' in model for model in model_list),
"all models should have name and RAM")

def test_lists_running_instances(self):
Expand Down

0 comments on commit ca9c7d8

Please sign in to comment.