-
Notifications
You must be signed in to change notification settings - Fork 45
Add Cache.status
property
#193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
e8dc3ca
Update the list of possible cache statuses
BelKed 0a3460f
Add `Cache.status` property
BelKed 46d6132
Set the cache status in the `Cache.load()` method
BelKed 9de597f
Set the cache status in the `Cache.load_quick()` method
BelKed 6b97b38
Set the cache status in the `_from_api_record` method
BelKed 7b04234
Dynamically return `state` based on `status`
BelKed f70c0d2
Remove setting of `state` property
BelKed a3c0a0b
Mark `Cache.state` property as deprecated
BelKed 43b3d3d
Fix issue with locked caches being considered archived using `Cache.l…
BelKed 432268b
Update a comment in `Cache.load_quick()` method
BelKed 40310bf
Don't set `state` in `Cache._from_api_record` method
BelKed cf39e38
Remove `state` from `known_kwargs` as it's read-only
BelKed 3a64738
Set `Cache.status` instead `state` in the `search` method
BelKed ad45beb
Update tests
BelKed 39bf130
Sort the imports correctly with `isort`
BelKed 87dcf18
Move the code for parsing cache status into the `Status.from_cache_de…
BelKed b9a643f
Add tests for all status values
BelKed 6e67e6e
Whitespace formatting
BelKed cd51a3e
Add a test for cache status with a quick load
BelKed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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,129 @@ | ||
{ | ||
"http_interactions": [ | ||
{ | ||
"recorded_at": "2022-08-25T19:41:18", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"User-Agent": [ | ||
"python-requests/2.28.1" | ||
] | ||
}, | ||
"method": "GET", | ||
"uri": "http://tiles01.geocaching.com/map.details?i=GC8CKQQ" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": null, | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Connection": [ | ||
"Keep-Alive" | ||
], | ||
"Content-Length": [ | ||
"0" | ||
], | ||
"Location": [ | ||
"https://tiles01.geocaching.com/map.details?i=GC8CKQQ" | ||
], | ||
"Server": [ | ||
"BigIP" | ||
] | ||
}, | ||
"status": { | ||
"code": 302, | ||
"message": "Moved Temporarily" | ||
}, | ||
"url": "http://tiles01.geocaching.com/map.details?i=GC8CKQQ" | ||
} | ||
}, | ||
{ | ||
"recorded_at": "2022-08-25T19:41:19", | ||
"request": { | ||
"body": { | ||
"encoding": "utf-8", | ||
"string": "" | ||
}, | ||
"headers": { | ||
"Accept": [ | ||
"*/*" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Cookie": [ | ||
"gspkauth=<AUTH COOKIE>" | ||
], | ||
"User-Agent": [ | ||
"python-requests/2.28.1" | ||
] | ||
}, | ||
"method": "GET", | ||
"uri": "https://tiles01.geocaching.com/map.details?i=GC8CKQQ" | ||
}, | ||
"response": { | ||
"body": { | ||
"encoding": "UTF-8", | ||
"string": "{\"status\":\"success\",\"data\":[{\"name\":\"Kohinoorka\",\"gc\":\"GC8CKQQ\",\"g\":\"0a786802-1a56-4c25-b52e-51e064ada861\",\"available\":true,\"archived\":false,\"subrOnly\":false,\"li\":false,\"fp\":\"15\",\"difficulty\":{\"text\":2.0,\"value\":\"2\"},\"terrain\":{\"text\":2.0,\"value\":\"2\"},\"hidden\":\"8/24/2019\",\"container\":{\"text\":\"Small\",\"value\":\"small.gif\"},\"type\":{\"text\":\"Traditional Cache\",\"value\":2},\"owner\":{\"text\":\"haj\u00edci\",\"value\":\"d9b10451-f71d-4d5a-be1d-7864fa92fdf0\"}}]}" | ||
}, | ||
"headers": { | ||
"Cache-Control": [ | ||
"no-cache" | ||
], | ||
"Content-Length": [ | ||
"444" | ||
], | ||
"Content-Type": [ | ||
"application/json; charset=UTF-8" | ||
], | ||
"Date": [ | ||
"Thu, 25 Aug 2022 19:41:19 GMT" | ||
], | ||
"Expires": [ | ||
"-1" | ||
], | ||
"Pragma": [ | ||
"no-cache" | ||
], | ||
"Strict-Transport-Security": [ | ||
"max-age=31536000; includeSubDomains" | ||
], | ||
"Vary": [ | ||
"Accept-Encoding" | ||
], | ||
"X-Content-Type-Options": [ | ||
"nosniff" | ||
], | ||
"X-Frame-Options": [ | ||
"SAMEORIGIN" | ||
], | ||
"X-XSS-Protection": [ | ||
"1" | ||
] | ||
}, | ||
"status": { | ||
"code": 200, | ||
"message": "OK" | ||
}, | ||
"url": "https://tiles01.geocaching.com/map.details?i=GC8CKQQ" | ||
} | ||
} | ||
], | ||
"recorded_with": "betamax/0.8.1" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.