mgmonteleone / python-atlasapi

python package for MongoDB Atlas Cloud provider
Apache License 2.0
21 stars 22 forks source link

Test Failure test_01_get_project_events_since #156

Closed mgmonteleone closed 1 year ago

mgmonteleone commented 1 year ago

test failure Traceback (most recent call last): File "/home/circleci/project/tests/test_events.py", line 44, in test_01_get_project_events_since out = self.a.Events._get_all_project_events(iterable=True, since_datetime=test_datetime) File "/home/circleci/project/atlasapi/atlas.py", line 926, in _get_all_project_events obj_list.append(atlas_event_factory(item)) File "/home/circleci/project/atlasapi/events.py", line 154, in atlas_event_factory return AtlasEvent(value_dict=value_dict) File "/home/circleci/project/atlasapi/events.py", line 71, in init super().init(value_dict) File "/home/circleci/project/atlasapi/events.py", line 35, in init self.event_type = AtlasEventTypes[value_dict.get('eventTypeName', 'UNKNOWN')] # type: AtlasEventTypes File "/home/circleci/.pyenv/versions/3.8.16/lib/python3.8/enum.py", line 387, in getitem return cls._membermap[name] KeyError: 'MAINTENANCE_WINDOW_MODIFIED'

mgmonteleone commented 1 year ago

Strange that this appears now...

It seams there is an ATLAS_ prefixed version of this event type, as well as a bare one.

So far only the ATLAS_ prefixed ones were there.

Adding the bare ones (MAINTENANCE_WINDOW_MODIFIED) to events_event_types.py as quick fix