Merge branch 'master' into extend-confserver-logging

This commit is contained in:
Brian Martin 2019-12-30 16:01:06 -05:00 committed by GitHub
commit 75aa74f39c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 365 additions and 111 deletions

View file

@ -133,7 +133,7 @@ async def test_login(aiohttp_client):
assert "username" in jsonresp["data"]
remove_existing_db()
bumper.db = "tests/tmp.db" # Set db location for testing
bumper.db = "tests/tmp.db" # Set db location for testing
# Test global_e without user
resp = await client.get("/v1/private/us/en/dev_1234/global_e/1/0/0/user/login")
@ -167,6 +167,25 @@ async def test_login(aiohttp_client):
assert "uid" in jsonresp["data"]
assert "username" in jsonresp["data"]
# Add a bot to db that doesn't have a did
newbot = {
"class": "dev_1234",
"company": "com_123",
#"did": self.did,
"name": "sn_1234",
"resource": "res_1234",
}
bumper.bot_full_upsert(newbot)
resp = await client.get("/v1/private/us/en/dev_1234/ios/1/0/0/user/login")
assert resp.status == 200
text = await resp.text()
jsonresp = json.loads(text)
assert jsonresp["code"] == bumper.RETURN_API_SUCCESS
assert "accessToken" in jsonresp["data"]
assert "uid" in jsonresp["data"]
assert "username" in jsonresp["data"]
async def test_logout(aiohttp_client):
remove_existing_db()
@ -527,6 +546,11 @@ async def test_getProductIotMap(aiohttp_client):
assert jsonresp["code"] == bumper.RETURN_API_SUCCESS
# Test getPimFile
resp = await client.get("/api/pim/file/get/123")
assert resp.status == 200
async def test_getUsersAPI(aiohttp_client):
remove_existing_db()
bumper.db = "tests/tmp.db" # Set db location for testing
@ -936,3 +960,5 @@ async def test_dim_devmanager(aiohttp_client):
test_resp = json.loads(text)
assert test_resp["ret"] == "fail"