def test_JsonFetcher_decodes_string_event_correctly(dummy_pv, json_fetcher):
    event_json = utils.load_from_file('string_event.json')
    mock_response = utils.mock_response(json_str=event_json)
    json_fetcher._fetch_data = mock.MagicMock(return_value=mock_response)
    aa_data = json_fetcher.get_values(dummy_pv, EARLY_DATE, LATE_DATE)
    assert (aa_data.pv == dummy_pv)
    assert (aa_data.values[0] == '2015-01-08 19:47:01 UTC')
    assert (aa_data.timestamps[0] == 1507712433.235971)
    assert (aa_data.severities[0] == 0)
def test_JsonFetcher_decodes_string_event_correctly(dummy_pv, json_fetcher):
    event_json = utils.load_from_file('string_event.json')
    mock_response = utils.mock_response(json_str=event_json)
    json_fetcher._fetch_data = mock.MagicMock(return_value=mock_response)
    aa_data = json_fetcher.get_values(dummy_pv, EARLY_DATE, LATE_DATE)
    assert (aa_data.pv == dummy_pv)
    assert (aa_data.values[0] == '2015-01-08 19:47:01 UTC')
    assert (aa_data.timestamps[0] == 1507712433.235971)
    assert (aa_data.severities[0] == 0)