1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

dxcli-847 add mikes tests back in

This commit is contained in:
howete 2013-06-05 09:35:16 -06:00 committed by Rupak Ganguly
parent aa3c01c9ce
commit 15467474c2
7 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,17 @@
Shindo.tests("HP::DNS | create domain tests", ['hp', 'dns', 'domain']) do
@create_format = {
id: String,
name: String,
ttl: Integer,
serial: Integer,
email: String,
created_at: String
}
tests('success') do
tests("#create_domain").formats(@create_format) do
HP[:dns].create_domain("name","joe@blow.com").body
end
end
end

View file

@ -0,0 +1,15 @@
Shindo.tests("HP::DNS | delete domain tests", ['hp', 'dns', 'domain']) do
@domain_id = "09494b72-b65b-4297-9efb-187f65a0553e"
@domain_bad = "09494b72-111-222-333"
tests('success') do
tests("#delete_domain(#{@domain_id})").succeeds do
HP[:dns].delete_domain(@domain_id)
end
end
tests('failure') do
tests("#delete_domain(#{@domain_bad})").raises(Fog::HP::DNS::NotFound) do
HP[:dns].delete_domain(@domain_bad)
end
end
end

View file

@ -0,0 +1,26 @@
Shindo.tests("HP::DNS | get domain tests", ['hp', 'dns', 'domain']) do
@domain_id = "09494b72-b65b-4297-9efb-187f65a0553e"
@domain_bad = "09494b72-111-222-333"
@domain_format = {
"id" => String,
"name" => String,
"ttl" => Integer,
"serial" => Integer,
"email" => String,
"created_at" => String
}
tests('success') do
tests("#get_domain(#{ @domain_id})").formats(@domain_format) do
HP[:dns].get_domain(@domain_id).body['domain']
end
end
tests('failure') do
tests("#get_domain(#{ @domain_bad})").raises(Fog::HP::DNS::NotFound) do
HP[:dns].get_domain(@domain_body)
end
end
end

View file

@ -0,0 +1,9 @@
Shindo.tests("HP::DNS | get servers hosting domain tests", ['hp', 'dns', 'domain']) do
tests('success') do
end
tests('failure') do
end
end

View file

@ -0,0 +1,17 @@
Shindo.tests("HP::DNS | list domains tests", ['hp', 'dns', 'domain']) do
@domain_format = {
"id" => String,
"name" => String,
"ttl" => Integer,
"serial" => Integer,
"email" => String,
"created_at" => String
}
tests('success') do
tests('#list_domains').formats({'domains' => [@domain_format]}) do
HP[:dns].list_domains.body
end
end
end

View file

@ -0,0 +1,20 @@
Shindo.tests("HP::DNS | list records tests", ['hp', 'dns', 'records']) do
@domain_id = "09494b72-b65b-4297-9efb-187f65a0553e"
@domain2 = "89acac79-38e7-497d-807c-a011e1310438"
@domain_bad = "09494b72-111-222-333"
tests('success') do
tests("#list_records_in_a_domain(#{@domain_id})").succeeds do
HP[:dns].list_records_in_a_domain(@domain_id)
end
tests("#list_records_in_a_domain(#{@domain2})").returns(true) do
HP[:dns].list_records_in_a_domain(@domain2).body["records"].count == 0
end
end
tests('failure') do
tests("#list_records_in_a_domain(#{@domain_bad})").raises(Fog::HP::DNS::NotFound) do
HP[:dns].list_records_in_a_domain(@domain_bad)
end
end
end

View file

@ -0,0 +1,9 @@
Shindo.tests("HP::DNS | list records tests", ['hp', 'dns', 'domains']) do
tests('success') do
end
tests('failure') do
end
end