def test_parse_invalid_openapi_spec_type(openapi_spec_generator):
  """Test that passing a non-dict object to parse raises TypeError"""
  with pytest.raises(AttributeError):
    openapi_spec_generator.parse(123)  # type: ignore

  with pytest.raises(AttributeError):
    openapi_spec_generator.parse("openapi_spec")  # type: ignore

  with pytest.raises(AttributeError):
    openapi_spec_generator.parse([])  # type: ignore
Test that passing a non-dict object to parse raises TypeError
tests/unittests/tools/openapi_tool/openapi_spec_parser/test_openapi_spec_parser.py