3147: PySDK tests use mock>=1.0 and easier mock side_effect.
[arvados.git] / services / api / test / integration / keep_proxy_test.rb
1 require 'test_helper'
2
3 class KeepProxyTest < ActionDispatch::IntegrationTest
4   test "request keep disks" do
5     get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active)
6     assert_response :success
7     services = json_response['items']
8
9     assert_equal 2, services.length
10     assert_equal 'disk', services[0]['service_type']
11     assert_equal 'disk', services[1]['service_type']
12
13     get "/arvados/v1/keep_services/accessible", {:format => :json}, auth(:active).merge({'HTTP_X_EXTERNAL_CLIENT' => '1'})
14     assert_response :success
15     services = json_response['items']
16
17     assert_equal 1, services.length
18
19     assert_equal "zzzzz-bi6l4-h0a0xwut9qa6g3a", services[0]['uuid']
20     assert_equal "keep.qr1hi.arvadosapi.com", services[0]['service_host']
21     assert_equal 25333, services[0]['service_port']
22     assert_equal true, services[0]['service_ssl_flag']
23     assert_equal 'proxy', services[0]['service_type']
24   end
25 end