-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test that gets 404 from Google (#107)
- Loading branch information
Erik Corry
authored
Jul 26, 2023
1 parent
5313013
commit 6a227f4
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright (C) 2023 Toitware ApS. | ||
// Use of this source code is governed by a Zero-Clause BSD license that can | ||
// be found in the tests/TESTS_LICENSE file. | ||
import certificate_roots show * | ||
import expect show * | ||
import http | ||
import net | ||
|
||
HOST ::= "google.com" | ||
PATH ::= "/nogood" | ||
CODE ::= 404 | ||
|
||
main: | ||
network := net.open | ||
client := http.Client.tls network | ||
|
||
client.root_certificates_.add GTS_ROOT_R1 | ||
|
||
response := client.get --host=HOST --path=PATH | ||
|
||
expect_equals CODE response.status_code |