From 014f552576fb472648aa432b9b18a5203e082b41 Mon Sep 17 00:00:00 2001 From: AndzejsP Date: Tue, 20 Jun 2023 08:46:53 +0300 Subject: [PATCH] added endpoint tests --- .gitignore | 6 +- tests/end_point_tests/endpoints.http | 138 ++++++++++++++++++ .../list_mounted_personalities.http | 5 - tests/end_point_tests/mount_personality.http | 8 - tests/end_point_tests/select_personality.http | 6 - .../end_point_tests/unmount_personality.http | 8 - 6 files changed, 143 insertions(+), 28 deletions(-) create mode 100644 tests/end_point_tests/endpoints.http delete mode 100644 tests/end_point_tests/list_mounted_personalities.http delete mode 100644 tests/end_point_tests/mount_personality.http delete mode 100644 tests/end_point_tests/select_personality.http delete mode 100644 tests/end_point_tests/unmount_personality.http diff --git a/.gitignore b/.gitignore index 61f11d9b..224ee93d 100644 --- a/.gitignore +++ b/.gitignore @@ -186,4 +186,8 @@ shared/* uploads global_paths_cfg.yaml -.vscode \ No newline at end of file +.vscode + +# Endpoint test files using REST client (VSCODE Extension) + +tests/end_point_tests/*_local.http \ No newline at end of file diff --git a/tests/end_point_tests/endpoints.http b/tests/end_point_tests/endpoints.http new file mode 100644 index 00000000..32586985 --- /dev/null +++ b/tests/end_point_tests/endpoints.http @@ -0,0 +1,138 @@ +############################################ +### Create new discussion +############################################ +GET http://localhost:9600/new_discussion +Content-Type: application/json + +{ + "title": "Some title" // Can be empty +} +############################################ +### List discussions +############################################ +GET http://localhost:9600/list_discussions +############################################ +### Load Discussion by ID +############################################ +POST http://localhost:9600/load_discussion +Content-Type: application/json + +{ + "id": 0 // Discussion ID Must be integer +} +############################################ +### Delete Discussion by ID +############################################ +POST http://localhost:9600/delete_discussion +Content-Type: application/json + +{ + "id": 0 // Discussion ID Must be integer +} +############################################ +### Edit discussion title +############################################ +POST http://localhost:9600/edit_title +Content-Type: application/json + +{ + "id": 0, // Discussion ID Must be integer + "title": "New title" +} +############################################ +### Update message +############################################ +GET http://localhost:9600/update_message +?id=0 +&message="New Message text" +############################################ +### Update setting +############################################ +POST http://localhost:9600/update_setting +Content-Type: application/json + +{ + "setting_name": "personality_language", + "setting_value": "english" +} +############################################ +### Get all personalities +############################################ +GET http://localhost:9600/get_all_personalities +############################################ +### Get current personality +############################################ +GET http://localhost:9600/get_current_personality +############################################ +### Get current personality infos +############################################ +GET http://localhost:9600/get_current_personality_path_infos +############################################ +### Mount personality +############################################ +POST http://localhost:9600/mount_personality +Content-Type: application/json + +{ + "language": "english", + "category": "generic", + "folder": "gpt4all" +} +############################################ +### Unmount personality +############################################ +POST http://localhost:9600/unmount_personality +Content-Type: application/json + +{ + "language": "english", + "category": "generic", + "name": "lollms" +} +############################################ +### Select personality +############################################ +POST http://localhost:9600/select_personality +Content-Type: application/json + +{ + "id": 0 // Array index from get_config.personalities array +} + +####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +### +### INFORMATION SECTION +### +####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +####@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ + + +############################################ +### List Models +############################################ +GET http://localhost:9600/list_models +############################################ +### Get avaliable Models +############################################ +GET http://localhost:9600/get_available_models +############################################ +### List Bindings +############################################ +GET http://localhost:9600/list_bindings +############################################ +### Get Config +############################################ +GET http://localhost:9600/get_config +############################################ +### Get generation status +############################################ +GET http://localhost:9600/get_generation_status +############################################ +### Get disk usage +############################################ +GET http://localhost:9600/disk_usage +############################################ +### Get ram usage +############################################ +GET http://localhost:9600/ram_usage \ No newline at end of file diff --git a/tests/end_point_tests/list_mounted_personalities.http b/tests/end_point_tests/list_mounted_personalities.http deleted file mode 100644 index 01cf461e..00000000 --- a/tests/end_point_tests/list_mounted_personalities.http +++ /dev/null @@ -1,5 +0,0 @@ -POST http://localhost:9600/list_mounted_personalities -Content-Type: application/json - -{ -} \ No newline at end of file diff --git a/tests/end_point_tests/mount_personality.http b/tests/end_point_tests/mount_personality.http deleted file mode 100644 index 91a77197..00000000 --- a/tests/end_point_tests/mount_personality.http +++ /dev/null @@ -1,8 +0,0 @@ -POST http://localhost:9600/mount_personality -Content-Type: application/json - -{ - "language": "english", - "category": "generic", - "name": "gpt4all" -} \ No newline at end of file diff --git a/tests/end_point_tests/select_personality.http b/tests/end_point_tests/select_personality.http deleted file mode 100644 index 37431f30..00000000 --- a/tests/end_point_tests/select_personality.http +++ /dev/null @@ -1,6 +0,0 @@ -POST http://localhost:9600/select_personality -Content-Type: application/json - -{ - "id": 0 -} \ No newline at end of file diff --git a/tests/end_point_tests/unmount_personality.http b/tests/end_point_tests/unmount_personality.http deleted file mode 100644 index a69e8eb2..00000000 --- a/tests/end_point_tests/unmount_personality.http +++ /dev/null @@ -1,8 +0,0 @@ -POST http://localhost:9600/unmount_personality -Content-Type: application/json - -{ - "language": "english", - "category": "generic", - "name": "gpt4all" -}