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

Commit

Permalink
Merge pull request #46 from richtier/fix-synchronise-device-state
Browse files Browse the repository at this point in the history
Handle 204 and 200 responses on synchronise device state
  • Loading branch information
richtier authored Jan 13, 2020
2 parents 2e441af + 98938d3 commit 0555c34
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
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

0 comments on commit 0555c34

Please sign in to comment.