Skip to content

Set "unknown" bfd_addr to None #124

Set "unknown" bfd_addr to None

Set "unknown" bfd_addr to None #124

GitHub Actions / Test results failed Nov 27, 2023 in 0s

2 fail, 60 pass in 41s

    3 files      3 suites   41s ⏱️
  62 tests   60 ✔️ 0 💤 2
186 runs  180 ✔️ 0 💤 6

Results for commit a3f89d9.

Annotations

Check warning on line 0 in tests.test_zinolib_event_types.EventTest

See this annotation in the file changed.

@github-actions github-actions / Test results

All 3 runs failed: test_create_event_from_minimal_dict_should_fail (tests.test_zinolib_event_types.EventTest)

artifacts/reports/py310/unit-results.xml
artifacts/reports/py311/unit-results.xml
artifacts/reports/py39/unit-results.xml
Raw output
@classmethod
    def create(cls, attrdict):
        event_type_string = attrdict["type"]
        subtype = Event.SUBTYPES[event_type_string]
        try:
>           eventobj = subtype(**attrdict)
E           pydantic_core._pydantic_core.ValidationError: 2 validation errors for AlarmEvent
E           alarm_count
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':...: <Type.ALARM: 'alarm'>}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing
E           alarm_type
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':...: <Type.ALARM: 'alarm'>}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing

src/zinolib/event_types.py:157: ValidationError

During handling of the above exception, another exception occurred:

self = <tests.test_zinolib_event_types.EventTest testMethod=test_create_event_from_minimal_dict_should_fail>

    def test_create_event_from_minimal_dict_should_fail(self):
        minimal_input = common_minimal_input.copy()
        minimal_input["type"] = Event.Type.ALARM
        with self.assertRaises(ValidationError):
>           event = Event.create(minimal_input)

tests/test_zinolib_event_types.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    @classmethod
    def create(cls, attrdict):
        event_type_string = attrdict["type"]
        subtype = Event.SUBTYPES[event_type_string]
        try:
            eventobj = subtype(**attrdict)
        except ValidationError as e:
>           raise ValueError(f"{e} {attrdict}")
E           ValueError: 2 validation errors for AlarmEvent
E           alarm_count
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':...: <Type.ALARM: 'alarm'>}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing
E           alarm_type
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':...: <Type.ALARM: 'alarm'>}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing {'id': 4576, 'adm_state': <AdmState.OPEN: 'open'>, 'router': 'fghjuy', 'opened': 1000000000, 'type': <Type.ALARM: 'alarm'>}

src/zinolib/event_types.py:159: ValueError

Check warning on line 0 in tests.test_zinolib_event_types.BFDEventTest

See this annotation in the file changed.

@github-actions github-actions / Test results

All 3 runs failed: test_create_bfd_event_sets_correct_fields (tests.test_zinolib_event_types.BFDEventTest)

artifacts/reports/py310/unit-results.xml
artifacts/reports/py311/unit-results.xml
artifacts/reports/py39/unit-results.xml
Raw output
cls = <class 'zinolib.event_types.Event'>
attrdict = {'adm_state': <AdmState.OPEN: 'open'>, 'bfd_ix': 4356, 'bfd_state': <BFDState.UP: 'up'>, 'id': 4576, ...}

    @classmethod
    def create(cls, attrdict):
        event_type_string = attrdict["type"]
        subtype = Event.SUBTYPES[event_type_string]
        try:
>           eventobj = subtype(**attrdict)
E           pydantic_core._pydantic_core.ValidationError: 1 validation error for BFDEvent
E           bfd_addr
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':..., 'lastevent': 'vfbghj'}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing

src/zinolib/event_types.py:157: ValidationError

During handling of the above exception, another exception occurred:

self = <tests.test_zinolib_event_types.BFDEventTest testMethod=test_create_bfd_event_sets_correct_fields>

    def test_create_bfd_event_sets_correct_fields(self):
        minimal_input = common_minimal_input.copy()
        minimal_input.update(**{
            "type": Event.Type.BFD,
            "bfd_state": BFDState.UP,
            "bfd_ix": 4356,
            "lastevent": "vfbghj",
        })
>       event = Event.create(minimal_input)

tests/test_zinolib_event_types.py:110: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'zinolib.event_types.Event'>
attrdict = {'adm_state': <AdmState.OPEN: 'open'>, 'bfd_ix': 4356, 'bfd_state': <BFDState.UP: 'up'>, 'id': 4576, ...}

    @classmethod
    def create(cls, attrdict):
        event_type_string = attrdict["type"]
        subtype = Event.SUBTYPES[event_type_string]
        try:
            eventobj = subtype(**attrdict)
        except ValidationError as e:
>           raise ValueError(f"{e} {attrdict}")
E           ValueError: 1 validation error for BFDEvent
E           bfd_addr
E             Field required [type=missing, input_value={'id': 4576, 'adm_state':..., 'lastevent': 'vfbghj'}, input_type=dict]
E               For further information visit https://errors.pydantic.dev/2.5/v/missing {'id': 4576, 'adm_state': <AdmState.OPEN: 'open'>, 'router': 'fghjuy', 'opened': 1000000000, 'type': <Type.BFD: 'bfd'>, 'bfd_state': <BFDState.UP: 'up'>, 'bfd_ix': 4356, 'lastevent': 'vfbghj'}

src/zinolib/event_types.py:159: ValueError

Check notice on line 0 in .github

See this annotation in the file changed.

@github-actions github-actions / Test results

62 tests found

There are 62 tests, see "Raw output" for the full list of tests.
Raw output
tests.config.test_tcl.ParseNormalizeTest ‑ test_normalize_empty_dict
tests.config.test_tcl.ParseNormalizeTest ‑ test_normalize_golden_path
tests.config.test_tcl.ParseTclConfigTest ‑ test_parse_tcl_config_empty_config_file
tests.config.test_tcl.ParseTclConfigTest ‑ test_parse_tcl_config_golden_path
tests.config.test_tcl.ParseTclConfigTest ‑ test_parse_tcl_config_missing_config_file
tests.config.test_toml.ParseTomlConfig ‑ test_parse_toml_config_empty_config_file
tests.config.test_toml.ParseTomlConfig ‑ test_parse_toml_config_golden_path
tests.config.test_toml.ParseTomlConfig ‑ test_parse_toml_config_missing_config_file
tests.config.test_utils.FindConfigFileTest ‑ test_find_config_file_golden_path
tests.config.test_utils.FindConfigFileTest ‑ test_find_config_file_missing_config_file
tests.config.test_utils.MakeFilenameSafeTest ‑ test_chop_away_path_bits
tests.config.test_utils.MakeFilenameSafeTest ‑ test_if_no_evil_return_input
tests.config.test_zino1.ParseTclTest ‑ test_parse_tcl_golden_path
tests.config.test_zino1.ZinoV1ConfigTest ‑ test_manually_create_config
tests.config.test_zino1.ZinoV1ConfigTest ‑ test_set_userauth
tests.config.test_zino1.ZinoV1ConfigTest ‑ test_update_from_args
tests.ritz.test_default.DefaultTest ‑ test_A_connect_imediate_disconnect
tests.ritz.test_default.DefaultTest ‑ test_B_connect_illegal_first_response
tests.ritz.test_default.DefaultTest ‑ test_D_connect_authentication_failed
tests.ritz.test_default.DefaultTest ‑ test_F_with
tests.ritz.test_default.DefaultTest ‑ test_G_get_attributes
tests.ritz.test_default.DefaultTest ‑ test_H_get_history
tests.ritz.test_default.DefaultTest ‑ test_I_add_history
tests.ritz.test_default.DefaultTest ‑ test_J_get_log
tests.ritz.test_default.DefaultTest ‑ test_K_set_state
tests.ritz.test_default.DefaultTest ‑ test_L_clear_flap
tests.ritz.test_default.DefaultTest ‑ test_M_poll_router
tests.ritz.test_default.DefaultTest ‑ test_N_ntie
tests.ritz.test_default.DefaultTest ‑ test_N_poll_interface
tests.ritz.test_slow.SlowTest ‑ test_C_connect_no_login_response
tests.ritz.test_slow.SlowTest ‑ test_E_connect_random_data_on_connect
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_cmd_attr
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_cmd_scavenged
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_cmd_state_is_closed_and_autoremove_is_off
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_cmd_state_is_closed_and_autoremove_is_on
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_cmd_state_is_not_closed
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_fallback
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_handle_known_type
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_handle_new_stateless_event_is_very_special
tests.test_zinolib_controllers_zino1.UpdateHandlerTest ‑ test_handle_unknown_type
tests.test_zinolib_controllers_zino1.Zino1EventManagerTest ‑ test_get_events
tests.test_zinolib_controllers_zino1.Zino1EventManagerTest ‑ test_get_history_for_id
tests.test_zinolib_controllers_zino1.Zino1EventManagerTest ‑ test_get_log_for_id
tests.test_zinolib_event_types.AlarmEventTest ‑ test_create_alarm_event_sets_correct_fields
tests.test_zinolib_event_types.BFDEventTest ‑ test_create_bfd_event_sets_correct_fields
tests.test_zinolib_event_types.BGPEventTest ‑ test_create_bgp_event_sets_correct_fields
tests.test_zinolib_event_types.EventManagerTest ‑ test__verify_session_wjen_no_session_should_fail_noisily
tests.test_zinolib_event_types.EventManagerTest ‑ test_get_event_with_id_should_succeed
tests.test_zinolib_event_types.EventManagerTest ‑ test_set_history_for_event
tests.test_zinolib_event_types.EventManagerTest ‑ test_set_log_for_event
tests.test_zinolib_event_types.EventTest ‑ test_ac_down_field_should_be_timedelta
tests.test_zinolib_event_types.EventTest ‑ test_create_event_from_empty_dict_should_complain_about_missing_type
tests.test_zinolib_event_types.EventTest ‑ test_create_event_from_minimal_dict_should_fail
tests.test_zinolib_event_types.EventTest ‑ test_create_event_from_subtype_correct_dict_should_succeed
tests.test_zinolib_event_types.EventTest ‑ test_get_downtime_should_fail_noisily_on_non_PortStateEvent
tests.test_zinolib_event_types.EventTest ‑ test_lasttrans_and_updated_should_be_datetime
tests.test_zinolib_event_types.HistoryEntryTest ‑ test_create_list_should_return_list_of_history_entries
tests.test_zinolib_event_types.LogEntryTest ‑ test_create_list_should_return_list_of_log_entries
tests.test_zinolib_event_types.PortStateEventTest ‑ test_create_port_state_event_sets_correct_fields
tests.test_zinolib_event_types.PortStateEventTest ‑ test_get_downtime_should_return_a_timedelta
tests.test_zinolib_event_types.ReachabilityEventTest ‑ test_create_reachability_event_sets_correct_fields
tests.test_zinolib_utils.GenerateAuthtokenTest ‑ test_generate_authtoken