Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added retrieve_apikey test and updated sample script

  • Loading branch information...
commit 63de3683a9826cd902b4ecc94ed3e9f402011ef8 1 parent 0dfada8
@slashk slashk authored
Showing with 16 additions and 2 deletions.
  1. +1 −2  bin/prowly_retrieve_apikey
  2. +15 −0 test/test_prowly.rb
View
3  bin/prowly_retrieve_apikey
@@ -45,8 +45,7 @@ if token_result.succeeded?
apikey_result = Prowly.retrieve_apikey(options[:provider], token_result.token)
if apikey_result.succeeded?
- puts "code returned is #{apikey_result.code}"
- puts "status is #{apikey_result.status}"
+ puts "The user apikey is #{apikey_result.apikey}"
exit(0)
else
puts "Error: #{apikey_result.message}"
View
15 test/test_prowly.rb
@@ -84,5 +84,20 @@ def test_verify_good_apikey_response
assert_equal(true, rt.succeeded?)
end
+ def test_good_retrieve_apikey_response
+ xml_response =
+<<EOF
+<?xml version="1.0" encoding="UTF-8"?>
+<prowl>
+ <success code="200" remaining="999" resetdate="1300659778" />
+ <retrieve apikey="15c501d2e65cfd46316513da47355283db4652fc" />
+</prowl>
+EOF
+ full_http_response = "200"
+ rt = Prowly::Response.new(xml_response, full_http_response)
+ assert_equal(rt.code, "200")
+ assert_equal(true, rt.succeeded?)
+ assert_equal("15c501d2e65cfd46316513da47355283db4652fc", rt.apikey)
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.