Ejemplo n.º 1
0
def test_frames_to_json(watson):
    watson.start('foo', tags=['A', 'B'])
    watson.stop()

    result = json.loads(frames_to_json(watson.frames))

    keys = {'id', 'start', 'stop', 'project', 'tags'}
    assert len(result) == 1
    assert set(result[0].keys()) == keys
    assert result[0]['project'] == 'foo'
    assert result[0]['tags'] == ['A', 'B']
Ejemplo n.º 2
0
def test_frames_to_json_empty_data(watson):
    assert frames_to_json(watson.frames) == '[]'