Beispiel #1
0
def test_set_name(mock_api):
    dev = Device(mock_api, LIGHT)
    dev.set_name('New name')
    assert len(mock_api.calls) == 1
    req = mock_api.calls[0]
    assert req['method'] == 'put'
    assert req['path'] == dev.path
    assert req['data'] == {ATTR_NAME: 'New name'}
def test_set_name():
    dev = Device(LIGHT_WS)
    command = dev.set_name('New name')

    assert command.method == 'put'
    assert command.path == dev.path
    assert command.data == {ATTR_NAME: 'New name'}