1
0
Fork 0
mirror of https://git.pleroma.social/pleroma/pleroma.git synced 2026-02-15 17:16:57 +00:00
pleroma/test
Phantasm b160a73924
Elixir 1.19: Fix typing violation in MediaControllerTest
warning: a struct for Plug.Upload is expected on struct update:

         %Plug.Upload{image | filename: "../../../../../nested/file.jpg"}

     but got type:

         dynamic()

     where "image" was given the type:

         # type: dynamic()
         # from: test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:132:42
         %{conn: conn, image: image}

     when defining the variable "image", you must also pattern match on "%Plug.Upload{}".

     hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

         user = some_function()
         %User{user | name: "John Doe"}

     it is enough to write:

         %User{} = user = some_function()
         %{user | name: "John Doe"}

     typing violation found at:
     │
 133 │       image = %Plug.Upload{
     │               ~
     │
     └─ test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:133:15: Pleroma.Web.MastodonAPI.MediaControllerTest."test Upload media Do not allow nested filename"/1
2026-02-12 23:44:27 +01:00
..
config Load an emoji.txt specific to the test env 2021-02-03 16:40:59 -06:00
credo/check/consistency Revert "Merge branch 'copyright-bump' into 'develop'" 2023-01-02 20:38:50 +00:00
fixtures test(http): reproduce hackney follow_redirect crash via CONNECT proxy 2026-01-16 21:17:40 +04:00
instance_static
mix Tests: Syncify tests that mutate global state. 2026-01-07 17:59:37 +04:00
pleroma Elixir 1.19: Fix typing violation in MediaControllerTest 2026-02-12 23:44:27 +01:00
support Merge branch 'phnt/mastoapi-misattribution-3381' into release/2.10-sec 2025-12-29 09:47:54 +04:00
test_helper.exs Elixir 1.18 Deal with :warnings_as_errors deprecation in compiler_options/1 2025-05-13 14:02:47 +02:00