Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .aspect/axl.axl
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,23 @@ def test_http(ctx: TaskContext, tc: int, temp_dir: str) -> int:

return tc

def test_http_get_post(ctx: TaskContext, tc: int, temp_dir: str) -> int:
# Test HTTP get and post methods including unix_socket support

# Test 1: Basic HTTP GET request (reuse same URL as download test)
url = "https://raw.githubusercontent.com/aspect-build/aspect-cli/refs/heads/main/LICENSE"
resp1 = ctx.http().get(url = url).block()
tc = test_case(tc, resp1.status == 200, "http.get should return status 200")
tc = test_case(tc, "Apache License" in resp1.body, "http.get body should contain Apache License text")
tc = test_case(tc, type(resp1.headers) == "list", "http.get headers should be a list")
tc = test_case(tc, len(resp1.headers) > 0, "http.get headers should not be empty")

# Test 2: HTTP GET with custom headers
resp2 = ctx.http().get(url = url, headers = {"User-Agent": "AXL-Test"}).block()
tc = test_case(tc, resp2.status == 200, "http.get with custom headers should return status 200")

return tc

def impl(ctx: TaskContext) -> int:
tc = 0

Expand Down Expand Up @@ -464,6 +481,7 @@ def impl(ctx: TaskContext) -> int:
tc = test_large_bes(ctx, tc, temp_dir)
tc = test_http(ctx, tc, temp_dir)
tc = test_bazel_info(ctx, tc)
tc = test_http_get_post(ctx, tc, temp_dir)

print(tc, "tests passed")
return 0
Expand Down