Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
e746b92e
Commit
e746b92e
authored
6 years ago
by
Paulus Schoutsen
Committed by
Fabian Affolter
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix deprecated code (#14681)
parent
7d2563eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
homeassistant/components/cloud/iot.py
+1
-1
1 addition, 1 deletion
homeassistant/components/cloud/iot.py
tests/components/cloud/test_iot.py
+1
-1
1 addition, 1 deletion
tests/components/cloud/test_iot.py
tests/components/test_conversation.py
+6
-6
6 additions, 6 deletions
tests/components/test_conversation.py
with
8 additions
and
8 deletions
homeassistant/components/cloud/iot.py
+
1
−
1
View file @
e746b92e
...
...
@@ -185,7 +185,7 @@ class CloudIoT:
yield
from
client
.
send_json
(
response
)
except
client_exceptions
.
WSServerHandshakeError
as
err
:
if
err
.
code
==
401
:
if
err
.
status
==
401
:
disconnect_warn
=
'
Invalid auth.
'
self
.
close_requested
=
True
# Should we notify user?
...
...
This diff is collapsed.
Click to expand it.
tests/components/cloud/test_iot.py
+
1
−
1
View file @
e746b92e
...
...
@@ -210,7 +210,7 @@ def test_cloud_connect_invalid_auth(mock_client, caplog, mock_cloud):
"""
Test invalid auth detected by server.
"""
conn
=
iot
.
CloudIoT
(
mock_cloud
)
mock_client
.
receive
.
side_effect
=
\
client_exceptions
.
WSServerHandshakeError
(
None
,
None
,
code
=
401
)
client_exceptions
.
WSServerHandshakeError
(
None
,
None
,
status
=
401
)
yield
from
conn
.
connect
()
...
...
This diff is collapsed.
Click to expand it.
tests/components/test_conversation.py
+
6
−
6
View file @
e746b92e
...
...
@@ -89,7 +89,7 @@ async def test_register_before_setup(hass):
assert
intent
.
text_input
==
'
I would like the Grolsch beer
'
async
def
test_http_processing_intent
(
hass
,
test
_client
):
async
def
test_http_processing_intent
(
hass
,
aiohttp
_client
):
"""
Test processing intent via HTTP API.
"""
class
TestIntentHandler
(
intent
.
IntentHandler
):
"""
Test Intent Handler.
"""
...
...
@@ -119,7 +119,7 @@ async def test_http_processing_intent(hass, test_client):
})
assert
result
client
=
await
test
_client
(
hass
.
http
.
app
)
client
=
await
aiohttp
_client
(
hass
.
http
.
app
)
resp
=
await
client
.
post
(
'
/api/conversation/process
'
,
json
=
{
'
text
'
:
'
I would like the Grolsch beer
'
})
...
...
@@ -243,7 +243,7 @@ async def test_toggle_intent(hass, sentence):
assert
call
.
data
==
{
'
entity_id
'
:
'
light.kitchen
'
}
async
def
test_http_api
(
hass
,
test
_client
):
async
def
test_http_api
(
hass
,
aiohttp
_client
):
"""
Test the HTTP conversation API.
"""
result
=
await
component
.
async_setup
(
hass
,
{})
assert
result
...
...
@@ -251,7 +251,7 @@ async def test_http_api(hass, test_client):
result
=
await
async_setup_component
(
hass
,
'
conversation
'
,
{})
assert
result
client
=
await
test
_client
(
hass
.
http
.
app
)
client
=
await
aiohttp
_client
(
hass
.
http
.
app
)
hass
.
states
.
async_set
(
'
light.kitchen
'
,
'
off
'
)
calls
=
async_mock_service
(
hass
,
'
homeassistant
'
,
'
turn_on
'
)
...
...
@@ -267,7 +267,7 @@ async def test_http_api(hass, test_client):
assert
call
.
data
==
{
'
entity_id
'
:
'
light.kitchen
'
}
async
def
test_http_api_wrong_data
(
hass
,
test
_client
):
async
def
test_http_api_wrong_data
(
hass
,
aiohttp
_client
):
"""
Test the HTTP conversation API.
"""
result
=
await
component
.
async_setup
(
hass
,
{})
assert
result
...
...
@@ -275,7 +275,7 @@ async def test_http_api_wrong_data(hass, test_client):
result
=
await
async_setup_component
(
hass
,
'
conversation
'
,
{})
assert
result
client
=
await
test
_client
(
hass
.
http
.
app
)
client
=
await
aiohttp
_client
(
hass
.
http
.
app
)
resp
=
await
client
.
post
(
'
/api/conversation/process
'
,
json
=
{
'
text
'
:
123
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment