Skip to content

Commit c2c9a52

Browse files
noerogJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Temperature data load should be a bytes object, not str. (GoogleCloudPlatform#1267)
1 parent eb49861 commit c2c9a52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

iot/api-client/end_to_end_example/cloudiot_pubsub_example_server_test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def test_config_turn_on(capsys):
3232
max_temp = 11
33-
data = {'temperature': max_temp}
33+
data = {b'temperature': max_temp}
3434

3535
Server = example_server.Server(service_account_json)
3636
Server._update_device_config(
@@ -48,7 +48,7 @@ def test_config_turn_on(capsys):
4848

4949
def test_config_turn_off(capsys):
5050
min_temp = -1
51-
data = {'temperature': min_temp}
51+
data = {b'temperature': min_temp}
5252

5353
Server = example_server.Server(service_account_json)
5454
Server._update_device_config(
@@ -60,3 +60,5 @@ def test_config_turn_off(capsys):
6060

6161
stdout, _ = capsys.readouterr()
6262
assert 'off' in stdout
63+
assert '-1' in stdout
64+
assert 'test-device-{}' in stdout

0 commit comments

Comments
 (0)