Skip to content

Commit

Permalink
Add test for valid type
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwolf committed Sep 17, 2024
1 parent d69cb01 commit f216e7b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions scripts/tests/test_ecs_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,40 @@ def test_normalize_always_array(self):
for (field_name, field) in self.ecs_fields.items():
self.assertIsInstance(field.get('normalize'), list, field_name)

def test_valid_type(self):
valid_types = ['binary',
'boolean',
'keyword',
'constant_keyword',
'wildcard',
'long',
'integer',
'short',
'byte',
'double',
'float',
'half_float',
'scaled_float',
'unsigned_long',
'date',
'date_nanos',
'alias',
'object',
'flattened',
'nested',
'join',
'long_range',
'double_range',
'date_range',
'ip',
'text',
'match_only_text',
'geo_point',
'geo_shape',
'point',
'shape']
for (field_name, field) in self.ecs_fields.items():
self.assertIn(field.get('type'), valid_types, field_name)

if __name__ == '__main__':
unittest.main()

0 comments on commit f216e7b

Please sign in to comment.