mirror of
https://github.com/puppetlabs/vmfloaty.git
synced 2026-01-25 21:28:40 -05:00
Update Faraday to 0.15, remove unnecessary headers
This commit is contained in:
parent
697cc878ef
commit
c140e7af48
4 changed files with 18 additions and 41 deletions
|
|
@ -48,7 +48,7 @@ describe Pooler do
|
|||
|
||||
it 'raises an AuthError if the token is invalid' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/debian-7-i386")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 401, :body => '{"ok":false}', :headers => {})
|
||||
|
||||
vm_hash = {}
|
||||
|
|
@ -58,7 +58,7 @@ describe Pooler do
|
|||
|
||||
it 'retrieves a single vm with a token' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/debian-7-i386")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @retrieve_response_body_single, :headers => {})
|
||||
|
||||
vm_hash = {}
|
||||
|
|
@ -71,7 +71,7 @@ describe Pooler do
|
|||
|
||||
it 'retrieves a multiple vms with a token' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/debian-7-i386+debian-7-i386+centos-7-x86_64")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @retrieve_response_body_double, :headers => {})
|
||||
|
||||
vm_hash = {}
|
||||
|
|
@ -100,7 +100,7 @@ describe Pooler do
|
|||
modify_hash = { :lifetime => 12 }
|
||||
stub_request(:put, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6")
|
||||
.with(:body => { '{"lifetime":12}' => true },
|
||||
:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
:headers => { 'Content-Type' => 'application/x-www-form-urlencoded', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @modify_response_body_success, :headers => {})
|
||||
|
||||
modify_req = Pooler.modify(false, @vmpooler_url, 'fq6qlpjlsskycq6', 'mytokenfile', modify_hash)
|
||||
|
|
@ -116,7 +116,7 @@ describe Pooler do
|
|||
|
||||
it 'deletes a specified vm' do
|
||||
stub_request(:delete, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @delete_response_body_success, :headers => {})
|
||||
|
||||
expect(Pooler.delete(false, @vmpooler_url, ['fq6qlpjlsskycq6'], 'mytokenfile')).to eq @delete_response
|
||||
|
|
@ -135,7 +135,6 @@ describe Pooler do
|
|||
|
||||
it 'prints the status' do
|
||||
stub_request(:get, "#{@vmpooler_url}/status")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent' => 'Faraday v0.9.2' })
|
||||
.to_return(:status => 200, :body => @status_response_body, :headers => {})
|
||||
|
||||
status = Pooler.status(false, @vmpooler_url)
|
||||
|
|
@ -159,7 +158,6 @@ describe Pooler do
|
|||
|
||||
it 'makes a query about a vm' do
|
||||
stub_request(:get, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent' => 'Faraday v0.9.2' })
|
||||
.to_return(:status => 200, :body => @query_response_body, :headers => {})
|
||||
|
||||
query_req = Pooler.query(false, @vmpooler_url, 'fq6qlpjlsskycq6')
|
||||
|
|
@ -174,7 +172,7 @@ describe Pooler do
|
|||
|
||||
it 'makes a snapshot for a single vm' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6/snapshot")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @snapshot_response_body, :headers => {})
|
||||
|
||||
snapshot_req = Pooler.snapshot(false, @vmpooler_url, 'fq6qlpjlsskycq6', 'mytokenfile')
|
||||
|
|
@ -189,7 +187,7 @@ describe Pooler do
|
|||
|
||||
it 'makes a request to revert a vm from a snapshot' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6/snapshot/dAfewKNfaweLKNve")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' })
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' })
|
||||
.to_return(:status => 200, :body => @revert_response_body, :headers => {})
|
||||
|
||||
revert_req = Pooler.revert(false, @vmpooler_url, 'fq6qlpjlsskycq6', 'mytokenfile', 'dAfewKNfaweLKNve')
|
||||
|
|
@ -213,7 +211,7 @@ describe Pooler do
|
|||
|
||||
it 'makes a request to extend disk space of a vm' do
|
||||
stub_request(:post, "#{@vmpooler_url}/vm/fq6qlpjlsskycq6/disk/12")
|
||||
.with(:headers => { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Content-Length' => '0', 'User-Agent' => 'Faraday v0.9.2', 'X-Auth-Token' => 'mytokenfile' }). to_return(:status => 200, :body => @disk_response_body_success, :headers => {})
|
||||
.with(:headers => { 'X-Auth-Token' => 'mytokenfile' }). to_return(:status => 200, :body => @disk_response_body_success, :headers => {})
|
||||
|
||||
disk_req = Pooler.disk(false, @vmpooler_url, 'fq6qlpjlsskycq6', 'mytokenfile', 12)
|
||||
expect(disk_req['ok']).to be true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue