'Assert that a particular `field` in the `event_dict` has a particular type'

def assert_field_type(self, event_dict, field, field_type):

    self.assertIn(field, event_dict, '{0}    not    found    in    the    root    of    the    event'.format(field))
    self.assertTrue(isinstance(event_dict[field], field_type), 'Expected    "{key}"    to    be    a    "{field_type}",    but    it    has    the    value    "{value}"    of    type    "{t}"'.format(key=field, value=event_dict[field], t=type(event_dict[field]), field_type=field_type))
