def test_update_notification(self, fledge_url, name='Test 1'):
    conn = http.client.HTTPConnection(fledge_url)
    data = {'notification_type': 'toggled'}
    conn.request('PUT', '/fledge/notification/{}'.format(urllib.parse.quote(name)), json.dumps(data))
    r = conn.getresponse()
    assert (200 == r.status)
    r = r.read().decode()
    jdoc = json.loads(r)
    assert ('Notification {} updated successfully'.format(name) == jdoc['result'])
    jdoc = _get_result(fledge_url, '/fledge/notification/{}'.format(urllib.parse.quote(name)))
    assert ('toggled' == jdoc['notification']['notificationType'])
def test_update_notification(self, fledge_url, name='Test 1'):
    conn = http.client.HTTPConnection(fledge_url)
    data = {'notification_type': 'toggled'}
    conn.request('PUT', '/fledge/notification/{}'.format(urllib.parse.quote(name)), json.dumps(data))
    r = conn.getresponse()
    assert (200 == r.status)
    r = r.read().decode()
    jdoc = json.loads(r)
    assert ('Notification {} updated successfully'.format(name) == jdoc['result'])
    jdoc = _get_result(fledge_url, '/fledge/notification/{}'.format(urllib.parse.quote(name)))
    assert ('toggled' == jdoc['notification']['notificationType'])