Skip to content

Commit

Permalink
Test package upload permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Acly committed Sep 21, 2024
1 parent 590bcea commit d88a4f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ai_diffusion/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
version = "1.25.0"

comfy_url = "https://github.com/comfyanonymous/ComfyUI"
comfy_version = "38c69080c742fcf1519a7aee4c4332ff7d1cd46c"
comfy_version = "dc96a1ae19b1d714a791f1fcb21578389955bbfd"


class CustomNode(NamedTuple):
Expand Down
15 changes: 15 additions & 0 deletions tests/test_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,18 @@ async def run_auto_update_test(tmp_path: Path):
assert updater.state is UpdateState.restart_required
assert updater.latest_version == new_version
assert install_test_file.read_text() == "if you're feeling orange, try flying a kite"


async def test_authorization():
if not has_local_cloud:
pytest.skip("No local cloud service found")
service_url = os.environ["TEST_SERVICE_URL"]
async with ClientSession(service_url) as session:

# Version check is public
async with session.get("/plugin/latest?version=1.2.3") as response:
assert response.status == 200

# Upload requires authorization
async with session.put("/plugin/upload/1.2.3") as response:
assert response.status == 401

0 comments on commit d88a4f8

Please sign in to comment.