Skip to content

Commit

Permalink
add test for requesting challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Blank committed Oct 12, 2023
1 parent 1c099f1 commit 7972a60
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/fixtures/cassettes/test_request_challenge
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
interactions:
- request:
body: null
headers:
Accept:
- '*/*'
Accept-Encoding:
- gzip, deflate
Connection:
- keep-alive
Content-Length:
- '0'
User-Agent:
- test_user_agent
method: POST
uri: https://lrclib.net/api/request-challenge
response:
body:
string: '{"prefix":"dkcXJrnbr0GY75W2H5Gqn3xcWdtzs5Qq","target":"000000FF00000000000000000000000000000000000000000000000000000000"}'
headers:
Access-Control-Allow-Origin:
- '*'
Content-Length:
- '121'
Content-Type:
- application/json; charset=utf-8
Date:
- Thu, 12 Oct 2023 08:23:49 GMT
Server:
- Caddy
- Caddy
Vary:
- Origin
status:
code: 200
message: OK
version: 1
7 changes: 7 additions & 0 deletions tests/test_api_with_vcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,10 @@ def test_not_found(api: LrcLibAPI) -> None:
233,
cached=False,
)


# test request challenge
@my_vcr.use_cassette()
def test_request_challenge(api: LrcLibAPI) -> None:
result = api.request_challenge()
assert isinstance(result, CryptographicChallenge)

0 comments on commit 7972a60

Please sign in to comment.