@@ -185,6 +185,8 @@ defmodule Testcontainers.Docker.Api do
185185 @ doc """
186186 Creates a Docker network.
187187 """
188+ # Suppress Dialyzer warnings - runtime behavior may differ from generated specs
189+ @ dialyzer { :nowarn_function , create_network: 3 }
188190 def create_network ( name , conn , opts \\ [ ] ) when is_binary ( name ) do
189191 driver = Keyword . get ( opts , :driver , "bridge" )
190192
@@ -201,36 +203,35 @@ defmodule Testcontainers.Docker.Api do
201203 { :ok , % DockerEngineAPI.Model.ErrorResponse { message: message } } ->
202204 { :error , { :failed_to_create_network , message } }
203205
204- { :error , % Tesla.Env { status: 409 } } ->
206+ { _ , % Tesla.Env { status: 409 } } ->
205207 { :ok , :already_exists }
206208
207- { :error , % Tesla.Env { status: status } } ->
209+ { _ , % Tesla.Env { status: status } } ->
208210 { :error , { :http_error , status } }
209-
210- { :error , reason } ->
211- { :error , reason }
212211 end
213212 end
214213
215214 @ doc """
216215 Removes a Docker network.
217216 """
217+ # Suppress Dialyzer warnings - runtime behavior may differ from generated specs
218+ @ dialyzer { :nowarn_function , remove_network: 2 }
218219 def remove_network ( name , conn ) when is_binary ( name ) do
219220 case Api.Network . network_delete ( conn , name ) do
220- { :ok , % Tesla.Env { status: 204 } } ->
221+ { :ok , nil } ->
222+ :ok
223+
224+ { _ , % Tesla.Env { status: 204 } } ->
221225 :ok
222226
223- { :ok , % Tesla.Env { status: 404 } } ->
227+ { _ , % Tesla.Env { status: 404 } } ->
224228 { :error , :network_not_found }
225229
226230 { :ok , % DockerEngineAPI.Model.ErrorResponse { message: message } } ->
227231 { :error , { :failed_to_remove_network , message } }
228232
229- { :error , % Tesla.Env { status: status } } ->
233+ { _ , % Tesla.Env { status: status } } ->
230234 { :error , { :http_error , status } }
231-
232- { :error , reason } ->
233- { :error , reason }
234235 end
235236 end
236237
@@ -417,8 +418,6 @@ defmodule Testcontainers.Docker.Api do
417418 end )
418419 end
419420
420- defp get_ip_from_networks ( _ ) , do: nil
421-
422421 defp create_exec ( container_id , command , conn ) do
423422 data = % ExecConfig { Cmd: command }
424423
0 commit comments