issue #23 - fixing issues from integration test
Unit test coverage / pytest (push) Failing after 1m9s
Unit test coverage / pytest (push) Failing after 1m9s
This commit is contained in:
@@ -24,7 +24,7 @@ from amqp.service.amq_service import AMQService
|
||||
class BRAGArgument:
|
||||
"""
|
||||
This class is used to represent a BRAG API input argument. It is uses FastAPI annotation to define the arguments
|
||||
(the argument type) that are passed as input arguments to the BRAG endpoint.
|
||||
(the argument type_string) that are passed as input arguments to the BRAG endpoint.
|
||||
"""
|
||||
|
||||
def __init__(self, arg: Any):
|
||||
@@ -88,7 +88,7 @@ def convert_to_argument(arg: BRAGArgument, value: str) -> Any:
|
||||
elif arg.is_base_model:
|
||||
return arg.arg.parse_raw(value)
|
||||
else:
|
||||
print(f"Unsupported argument type: {type(arg)}")
|
||||
print(f"Unsupported argument type_string: {type(arg)}")
|
||||
except Exception as e:
|
||||
print(f"Error converting argument {arg}: {e}")
|
||||
return None
|
||||
@@ -104,8 +104,11 @@ class CleverBragAmqpAdapter(CleverThisServiceAdapter):
|
||||
amq_configuration: AMQConfiguration,
|
||||
routes: List[APIRoute],
|
||||
auth_provider: core.base.providers.auth.AuthProvider,
|
||||
extra_init_data: dict,
|
||||
):
|
||||
super().__init__(amq_configuration, routes, None)
|
||||
super().__init__(
|
||||
amq_configuration, routes, None, "auth_user", extra_init_data=extra_init_data
|
||||
)
|
||||
self.auth_provider = auth_provider
|
||||
_amq_service: AMQService = AMQService(amq_configuration, self)
|
||||
self.thread = Thread(target=_amq_service.run)
|
||||
|
||||
+4
-1
@@ -21,7 +21,10 @@ if __name__ == "__main__":
|
||||
r2rapp: R2RApp = create_r2r_app()
|
||||
|
||||
adapter: CleverBragAmqpAdapter = CleverBragAmqpAdapter(
|
||||
AMQConfiguration("./application.properties.local"), r2rapp.app.routes, r2rapp.providers.auth
|
||||
AMQConfiguration("./application.properties.local"),
|
||||
r2rapp.app.routes,
|
||||
r2rapp.providers.auth,
|
||||
{"app": r2rapp.config.app},
|
||||
)
|
||||
|
||||
for method, routes in adapter.routes.items():
|
||||
|
||||
Reference in New Issue
Block a user