Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
end

puts "Test Coverage is #{count_of_calls}/#{count_of_methods}"
expect(count_of_calls / count_of_methods.to_f > 0.4).to be_truthy
expect(count_of_calls / count_of_methods.to_f > 0.95).to be_truthy
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,29 @@
headers['x-ms-client-request-id'] = @validClientId
result = @client.xms_client_request_id.get_async(headers).value!
expect(result.response.status).to eq(200)
expect(result.request_id).to eq("123")
expect(result.response.headers['x-ms-request-id']).to eq("123")
end

# it 'should not overwrite x-ms-client-request-id' do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this one be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually that is a valid test but looks like we have a bung that overrides client-request-id even though we set it to false. I'd prefer to keep it here as when we resolve that we can enable that test as well.


In reply to: 69021567 [](ancestors = 69021567)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good!

# test_client = AutoRestAzureSpecialParametersTestClient.new(@credentials, @base_url)
# test_client.subscription_id = @validSubscription
# test_client.generate_client_request_id = false
#
# result = test_client.xms_client_request_id.get_async().value!
# expect(result.response.status).to eq(200)
# expect(result.response.headers['x-ms-request-id']).to eq("123")
# end

it 'should have x-ms-request-id in the error object' do
headers = Hash.new
headers['x-ms-client-request-id'] = '123'

begin
@client.xms_client_request_id.get_async(headers).value!
fail 'should have thrown MsRestAzure::AzureOperationError'
rescue MsRestAzure::AzureOperationError => error
expect(error.response.headers['x-ms-request-id']).to eq("123")
end
end

it 'should overwrite hard coded headers with custom headers from parameters' do
Expand All @@ -163,11 +185,15 @@
end

it 'should allow custom-named request-id headers to be used with parameter grouping' do
pending 'Ruby does not support parameter grouping yet'
fail
result = @client.header.custom_named_request_id_async(@validClientId).value!
expect(result.response.status).to eq(200)
expect(result.request_id).to eq("123")
end

# OData filters Tests
it 'should support OData filter' do
filter = "id gt 5 and name eq 'foo'"
result = @client.odata.get_with_filter_async(filter, 10, 'id').value!
expect(result.response.status).to eq(200)
end
end
Loading