Skip to content
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

Added unit tests #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ udocs/
build.*
docsbuild.bat
*.egg-info
.pytest_cache
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pytest
pytest-vcr
pytest-asyncio
pytest-cov
python-dateutil
httpx
56 changes: 56 additions & 0 deletions tests/cassettes/test_banned_get_users.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
interactions:
- request:
body: '{"userIds": [39718632], "excludeBannedUsers": false}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '52'
content-type:
- application/json
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: POST
uri: https://users.roblox.com/v1/users
response:
content: '{"data":[{"id":39718632,"name":"ErichModel","displayName":"ErichModel"}]}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '89'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:56 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI2-WEB1490
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
version: 1
56 changes: 56 additions & 0 deletions tests/cassettes/test_banned_get_users_by_username[user_name0].yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
interactions:
- request:
body: '{"usernames": ["ErichModel"], "excludeBannedUsers": false}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '58'
content-type:
- application/json
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: POST
uri: https://users.roblox.com/v1/usernames/users
response:
content: '{"data":[{"requestedUsername":"ErichModel","id":39718632,"name":"ErichModel","displayName":"ErichModel"}]}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '100'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:59 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI1-WEB7909
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
version: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
interactions:
- request:
body: '{"userIds": [39718632], "excludeBannedUsers": true}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '51'
content-type:
- application/json
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: POST
uri: https://users.roblox.com/v1/users
response:
content: '{"data":[]}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '46'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:56 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI1-WEB1675
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
version: 1
161 changes: 161 additions & 0 deletions tests/cassettes/test_expand_get_users[user_ids0].yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
interactions:
- request:
body: '{"userIds": [2067807455, 1], "excludeBannedUsers": false}'
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
content-length:
- '57'
content-type:
- application/json
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: POST
uri: https://users.roblox.com/v1/users
response:
content: '{"data":[{"id":2067807455,"name":"ro_python","displayName":"ro_python"},{"id":1,"name":"Roblox","displayName":"Roblox"}]}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '107'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:55 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI2-WEB1496
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: GET
uri: https://users.roblox.com/v1/users/2067807455
response:
content: '{"description":"For use in ro.py examples.","created":"2020-12-07T20:28:33.03Z","isBanned":false,"externalAppDisplayName":null,"id":2067807455,"name":"ro_python","displayName":"ro_python"}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '166'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:55 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI2-WEB1035
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
- request:
body: ''
headers:
accept:
- '*/*'
accept-encoding:
- gzip, deflate
connection:
- keep-alive
host:
- users.roblox.com
referer:
- www.roblox.com
user-agent:
- Roblox/WinInet
method: GET
uri: https://users.roblox.com/v1/users/1
response:
content: '{"description":"Welcome to the Roblox profile! This is where you can
check out the newest items in the catalog, and get a jumpstart on exploring
and building on our Imagination Platform. If you want news on updates to the
Roblox platform, or great new experiences to play with friends, check out blog.roblox.com.
Please note, this is an automated account. If you need to reach Roblox for any
customer service needs find help at www.roblox.com/help","created":"2006-02-27T21:06:40.3Z","isBanned":false,"externalAppDisplayName":null,"id":1,"name":"Roblox","displayName":"Roblox"}'
headers:
cache-control:
- no-cache
content-encoding:
- gzip
content-length:
- '372'
content-type:
- application/json; charset=utf-8
date:
- Tue, 17 May 2022 15:29:55 GMT
expires:
- '-1'
nel:
- '{"report_to":"network-errors","max_age":604800,"success_fraction":0.001,"failure_fraction":1}'
p3p:
- CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
pragma:
- no-cache
report-to:
- '{"group":"network-errors","max_age":604800,"endpoints":[{"url":"https://ncs.roblox.com/upload"}]}'
roblox-machine-id:
- CHI1-WEB7433
strict-transport-security:
- max-age=3600
vary:
- Accept-Encoding
x-frame-options:
- SAMEORIGIN
http_version: HTTP/1.1
status_code: 200
version: 1
Loading