pythonhacktoberfeststeamauthenticationauthenticatorsteam-authenticatorsteam-clientsteam-guard-codessteam-websteamworksvalvewebapi
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
import mock
|
|
from steam import webapi
|
|
import unittest
|
|
|
|
|
|
class TestWebAPI(unittest.TestCase):
|
|
@mock.patch('steam.webapi.WebAPI._api_request', mock.Mock())
|
|
@mock.patch('steam.webapi.WebAPI.load_interfaces', mock.Mock())
|
|
def test_with_key(self):
|
|
api = webapi.WebAPI(key='testkey')
|
|
api.ISteamUser = webapi.WebAPIInterface({
|
|
'name': 'ISteamUser',
|
|
'methods': [
|
|
{
|
|
"name": "GetPlayerSummaries",
|
|
"version": 2,
|
|
"httpmethod": "GET",
|
|
"parameters": [
|
|
{
|
|
"name": "key",
|
|
"type": "string",
|
|
"optional": False,
|
|
"description": "access key"
|
|
},
|
|
{
|
|
"name": "steamids",
|
|
"type": "string",
|
|
"optional": False,
|
|
"description": "Comma-delimited list of SteamIDs (max: 100)"
|
|
}
|
|
]
|
|
|
|
},
|
|
|
|
]
|
|
}, parent=api)
|
|
api.ISteamUser.GetPlayerSummaries(steamids='76561197960435530')
|
|
|