Skip to content

Commit

Permalink
Post-merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Kruhlmann committed Mar 22, 2024
1 parent 01f56cb commit 619dbcc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 47 deletions.
12 changes: 6 additions & 6 deletions lib/api/community/achievement.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let get_available game domain send =
| None -> Lwt.return None
;;

let get ?(profile_ids=[]) game domain send =
let get ?(profile_ids = []) game domain send =
match profile_ids with
| [] -> Lwt.fail_with "Profile IDs list cannot be empty"
| _ids ->
Expand All @@ -20,9 +20,9 @@ let get ?(profile_ids=[]) game domain send =
Uri.with_query' base_url [ "title", Data.Game.to_str game; "profileids", Data.Query.encode_lst_i profile_ids ]
in
let* json = send url in
match json with
| Some j ->
let model = Models.Response.Community.Achievement_attainment.from_json j in
Lwt.return @@ Some model
| None -> Lwt.return None
(match json with
| Some j ->
let model = Models.Response.Community.Achievement_attainment.from_json j in
Lwt.return @@ Some model
| None -> Lwt.return None)
;;
39 changes: 0 additions & 39 deletions lib/models/response/community/user_achievements.ml

This file was deleted.

3 changes: 2 additions & 1 deletion tests/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let () =
, [ Alcotest_lwt.test_case "/community/advertisement/findAdvertisements" `Quick (fun _ () ->
Test_cases.Api.test_get_advertisements ())
; Alcotest_lwt.test_case "/community/news/getNews" `Quick (fun _ () -> Test_cases.Api.test_get_news ())
; Alcotest_lwt.test_case "/community/achievement/getAchievements" `Quick (fun _ () -> Test_cases.Api.test_get_achievements ())
; Alcotest_lwt.test_case "/community/achievement/getAchievements" `Quick (fun _ () ->
Test_cases.Api.test_get_achievements ())
; Alcotest_lwt.test_case "/community/achievement/getAvailableAchievements" `Quick (fun _ () ->
Test_cases.Api.test_get_available_achievements ())
] )
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cases/api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ let test_get_available_achievements () =
let test_get_achievements () =
let requester = Mock.Json_file.create_requester "getAchievements.json" in
let client = Client.create "aoe-api.worldsedgelink.com" Data.Game.Age2 in
Client.get (Api.Community.Achievement.get ~profile_ids:[1]) client ~requester
Client.get (Api.Community.Achievement.get ~profile_ids:[ 1 ]) client ~requester
>>= function
| Some r -> Lwt.return @@ Alcotest.(check string) "Response was success" "SUCCESS" r.result.message
| None -> Lwt.fail_with "Expected Some but got None"
Expand Down

0 comments on commit 619dbcc

Please sign in to comment.