[PATCH conductor] Fix failing oauth tests
Jason Guiditta
jguiditt at redhat.com
Fri Jul 27 21:09:41 UTC 2012
On 27/07/12 15:47 -0400, John Eckersberg wrote:
>The URIs in the cassette look like:
>
>http://example.com:5000/katello/api/organizations
>
>But the tests were initializing the oauth client with
>http://example.com:5000/api and then issuing a GET on
>/katello/api/organizations; so ultimately:
>
>http://example.com:5000/api/katello/api/organizations
>
>This didn't match the cassette, so VCR would pass the connection on to
>the real source (example.org:5000) and would eventually timeout.
>---
> src/spec/lib/oauth_client_spec.rb | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
>diff --git a/src/spec/lib/oauth_client_spec.rb b/src/spec/lib/oauth_client_spec.rb
>index 8fd7627..9ce522a 100644
>--- a/src/spec/lib/oauth_client_spec.rb
>+++ b/src/spec/lib/oauth_client_spec.rb
>@@ -26,11 +26,11 @@ describe OAuthClient do
>
> it "should get authenticated resource with custom header" do
> # These are the proper configurations
>- SETTINGS_CONFIG[:oauth]['http://example.com:5000/api'] = {
>+ SETTINGS_CONFIG[:oauth]['http://example.com:5000'] = {
> :consumer_key => 'valid',
> :consumer_secret => 'good_secret'
> }
>- client = OAuthClient.new('http://example.com:5000/api')
>+ client = OAuthClient.new('http://example.com:5000')
> consumer = client.instance_variable_get('@consumer')
> # We need to stub out sign! since it's otherwise unique on every request
> consumer.stub('sign!') do |request, *args|
>@@ -42,11 +42,11 @@ describe OAuthClient do
> end
>
> it "should return a 401 for invalid credentials" do
>- SETTINGS_CONFIG[:oauth]['http://example.com:5000/api'] = {
>+ SETTINGS_CONFIG[:oauth]['http://example.com:5000'] = {
> :consumer_key => 'test',
> :consumer_secret => 'failure'
> }
>- client = OAuthClient.new('http://example.com:5000/api')
>+ client = OAuthClient.new('http://example.com:5000')
> consumer = client.instance_variable_get('@consumer')
> consumer.stub('sign!') do |request, *args|
> request['authorization'] = 'OAuth oauth_consumer_key="test", oauth_nonce="zoT39JgdwI0fjqg9ZfJ2xN4QxyJyIghW7wWUHAxfY", oauth_signature="UFM87n9CcQXGsOUbHttPJs9NQOg%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1317068970", oauth_version="1.0"'
>--
>1.7.11.2
>
ACK/pushed, tests now pass both upstream in in rpm mode, way to go!
-j
More information about the aeolus-devel
mailing list