Skip to content

Commit

Permalink
move allow
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoegel committed Jun 19, 2024
1 parent 9670938 commit 82e9771
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/call_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def get_manteca_test_status(test_id)
end

def cleanup_calls(calls, calls_api)
WebMock.allow_net_connect!
attempts = 0

while (calls.length > 0 && attempts < 10)
Expand All @@ -52,16 +51,16 @@ def cleanup_calls(calls, calls_api)
error_message = 'Failed to terminate all calls' + calls.to_s
raise StandardError.new error_message
end
WebMock.disable_net_connect!
end

def call_ended(call_id, calls_api)
WebMock.allow_net_connect!
begin
response = calls_api.get_call_state(BW_ACCOUNT_ID, call_id)
rescue Bandwidth::ApiError
return false
end

if !(response.state == 'disconnected')
begin
calls_api.update_call(BW_ACCOUNT_ID, call_id, $complete_call_body)
Expand All @@ -71,6 +70,7 @@ def call_ended(call_id, calls_api)
else
return true
end
WebMock.disable_net_connect!

false
end

0 comments on commit 82e9771

Please sign in to comment.