mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[dns] first pass at model tests
This commit is contained in:
parent
75ea9c3fb8
commit
803ceefb91
20 changed files with 122 additions and 1 deletions
5
tests/aws/models/dns/zone_tests.rb
Normal file
5
tests/aws/models/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('AWS::DNS | zone model', ['aws']) do
|
||||
|
||||
zone_tests(AWS[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/aws/models/dns/zones_tests.rb
Normal file
5
tests/aws/models/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('AWS::DNS | zones collection', ['aws']) do
|
||||
|
||||
zones_tests(AWS[:dns], {}, false)
|
||||
|
||||
end
|
|
@ -14,6 +14,11 @@ require 'helpers/compute/flavors_tests'
|
|||
require 'helpers/compute/server_tests'
|
||||
require 'helpers/compute/servers_tests'
|
||||
|
||||
require 'helpers/dns/record_tests'
|
||||
require 'helpers/dns/records_tests'
|
||||
require 'helpers/dns/zone_tests'
|
||||
require 'helpers/dns/zones_tests'
|
||||
|
||||
require 'helpers/storage/directory_tests'
|
||||
require 'helpers/storage/directories_tests'
|
||||
require 'helpers/storage/file_tests'
|
||||
|
|
13
tests/helpers/dns/record_tests.rb
Normal file
13
tests/helpers/dns/record_tests.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
def record_tests(connection, params = {}, mocks_implemented = true)
|
||||
|
||||
params = {:ip => '1.2.3.4', :name => 'www.fogrecordtests.com', :type => 'A'}.merge!(params)
|
||||
|
||||
if !Fog.mocking? || mocks_implemented
|
||||
@zone = connection.zones.create(:domain => 'fogrecordtests.com')
|
||||
|
||||
model_tests(@zone.records, params, mocks_implemented)
|
||||
|
||||
@zone.destroy
|
||||
end
|
||||
|
||||
end
|
13
tests/helpers/dns/records_tests.rb
Normal file
13
tests/helpers/dns/records_tests.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
def records_tests(connection, params = {}, mocks_implemented = true)
|
||||
|
||||
params = {:ip => '1.2.3.4', :name => 'www.fogrecordstests.com', :type => 'A'}.merge!(params)
|
||||
|
||||
if !Fog.mocking? || mocks_implemented
|
||||
@zone = connection.zones.create(:domain => 'fogrecordstests.com')
|
||||
|
||||
collection_tests(@zone.records, params, mocks_implemented)
|
||||
|
||||
@zone.destroy
|
||||
end
|
||||
|
||||
end
|
7
tests/helpers/dns/zone_tests.rb
Normal file
7
tests/helpers/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
def zone_tests(connection, params = {}, mocks_implemented = true)
|
||||
|
||||
params = {:domain => 'fogzonetests.com'}.merge!(params)
|
||||
|
||||
model_tests(connection.zones, params, mocks_implemented)
|
||||
|
||||
end
|
7
tests/helpers/dns/zones_tests.rb
Normal file
7
tests/helpers/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
def zones_tests(connection, params = {}, mocks_implemented = true)
|
||||
|
||||
params = {:domain => 'fogzonestests.com'}.merge!(params)
|
||||
|
||||
collection_tests(connection.zones, params, mocks_implemented)
|
||||
|
||||
end
|
|
@ -10,7 +10,7 @@ def directory_tests(connection, params = {}, mocks_implemented = true)
|
|||
end
|
||||
|
||||
if !Fog.mocking? || mocks_implemented
|
||||
responds_to(:public_url)
|
||||
@instance.responds_to(:public_url)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
5
tests/linode/models/dns/record_tests.rb
Normal file
5
tests/linode/models/dns/record_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Linode::DNS | record model', ['linode']) do
|
||||
|
||||
record_tests(Linode[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/linode/models/dns/records_tests.rb
Normal file
5
tests/linode/models/dns/records_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Linode::DNS | records collection', ['linode']) do
|
||||
|
||||
records_tests(Linode[:dns], {}, false)
|
||||
|
||||
end
|
11
tests/linode/models/dns/zone_tests.rb
Normal file
11
tests/linode/models/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
Shindo.tests('Linode::DNS | zone model', ['linode']) do
|
||||
|
||||
zone_tests(Linode[:dns], {}, false) do
|
||||
|
||||
if !Fog.mocking? || mocks_implemented
|
||||
@instance.responds_to(:nameservers)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
5
tests/linode/models/dns/zones_tests.rb
Normal file
5
tests/linode/models/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Linode::DNS | zones collection', ['linode']) do
|
||||
|
||||
zones_tests(Linode[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/slicehost/models/dns/record_tests.rb
Normal file
5
tests/slicehost/models/dns/record_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Slicehost::DNS | record model', ['slicehost']) do
|
||||
|
||||
record_tests(Slicehost[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/slicehost/models/dns/records_tests.rb
Normal file
5
tests/slicehost/models/dns/records_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Slicehost::DNS | records collection', ['slicehost']) do
|
||||
|
||||
records_tests(Slicehost[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/slicehost/models/dns/zone_tests.rb
Normal file
5
tests/slicehost/models/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Slicehost::DNS | zone model', ['slicehost']) do
|
||||
|
||||
zone_tests(Slicehost[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/slicehost/models/dns/zones_tests.rb
Normal file
5
tests/slicehost/models/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Slicehost::DNS | zones collection', ['slicehost']) do
|
||||
|
||||
zones_tests(Slicehost[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/zerigo/models/dns/record_tests.rb
Normal file
5
tests/zerigo/models/dns/record_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Zerigo::DNS | record model', ['zerigo']) do
|
||||
|
||||
record_tests(Zerigo[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/zerigo/models/dns/records_tests.rb
Normal file
5
tests/zerigo/models/dns/records_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Zerigo::DNS | records collection', ['zerigo']) do
|
||||
|
||||
records_tests(Zerigo[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/zerigo/models/dns/zone_tests.rb
Normal file
5
tests/zerigo/models/dns/zone_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Zerigo::DNS | zone model', ['zerigo']) do
|
||||
|
||||
zone_tests(Zerigo[:dns], {}, false)
|
||||
|
||||
end
|
5
tests/zerigo/models/dns/zones_tests.rb
Normal file
5
tests/zerigo/models/dns/zones_tests.rb
Normal file
|
@ -0,0 +1,5 @@
|
|||
Shindo.tests('Zerigo::DNS | zones collection', ['zerigo']) do
|
||||
|
||||
zones_tests(Zerigo[:dns], {}, false)
|
||||
|
||||
end
|
Loading…
Add table
Reference in a new issue