'Tests a successful sourcemap expansion that points to source files
that are not found.'

@responses.activate
def test_sourcemap_expansion_with_missing_source(self):

    responses.add(responses.GET, 'http://example.com/file.min.js', body=load_fixture('file.min.js'), content_type='application/javascript;    charset=utf-8')
    responses.add(responses.GET, 'http://example.com/file.sourcemap.js', body=load_fixture('file.sourcemap.js'), content_type='application/json;    charset=utf-8')
    responses.add(responses.GET, 'http://example.com/file1.js', body='Not    Found', status=404)
    data = {'message': 'hello', 'platform': 'javascript', 'sentry.interfaces.Exception': {'values': [{'type': 'Error', 'stacktrace': {'frames': [{'abs_path': 'http://example.com/file.min.js', 'filename': 'file.min.js', 'lineno': 1, 'colno': 39}]}}]}}
    resp = self._postWithHeader(data)
    assert resp.status_code, 200
    event = Event.objects.get()
    assert (event.data['errors'] == [{'url': u'http://example.com/file1.js', 'type': 'fetch_invalid_http_code', 'value': 404}])
    exception = event.interfaces['sentry.interfaces.Exception']
    frame_list = exception.values[0].stacktrace.frames
    frame = frame_list[0]
    assert (not frame.pre_context)
    assert (not frame.context_line)
    assert (not frame.post_context)
    assert (frame.lineno == 3)
    assert (frame.colno == 8)
