Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Handle 204 and 200 responses on synchronise device state #46

Merged
merged 1 commit into from
Jan 13, 2020
Merged
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.5.1
[Full Changelog](https://github.com/richtier/alexa-voice-service-client/pull/46)
### Fixed bugs
- Handle 204 and 200 responses on synchronise device state

## 1.5.0
[Full Changelog](https://github.com/richtier/alexa-voice-service-client/pull/35)
### Implemented enhancements
Expand Down
2 changes: 1 addition & 1 deletion alexa_client/alexa_client/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def synchronise_device_state(self, device_state, authentication_headers):
headers=headers,
)
response = self.connection.get_response(stream_id)
assert response.status == http.client.NO_CONTENT
assert response.status in (http.client.NO_CONTENT, http.client.OK)

def send_audio_file(
self, audio_file, device_state, authentication_headers,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='alexa_client',
version='1.5.0',
version='1.5.1',
packages=find_packages(exclude=["tests.*", "tests"]),
url='https://github.com/richtier/alexa-voice-service-client',
license='MIT',
Expand Down
5 changes: 3 additions & 2 deletions tests/alexa_client/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@ def test_establish_downstream_conncetion(manager, authentication_headers):
}


@pytest.mark.parametrize("status_code", [200, 204])
def test_synchronise_device_state(
manager, authentication_headers, device_state
manager, authentication_headers, device_state, status_code
):
manager.create_connection()
manager.mock_response(status_code=204)
manager.mock_response(status_code=status_code)

manager.synchronise_device_state(
authentication_headers=authentication_headers,
Expand Down