solusvm 1.4.0 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +0 -1
- data/LICENSE +1 -1
- data/README.markdown +159 -116
- data/Rakefile +3 -33
- data/bin/solusvm +3 -4
- data/lib/solusvm.rb +1 -3
- data/lib/solusvm/base.rb +101 -46
- data/lib/solusvm/cli.rb +8 -8
- data/lib/solusvm/cli/base_cli.rb +3 -3
- data/lib/solusvm/cli/client_cli.rb +3 -5
- data/lib/solusvm/cli/general_cli.rb +3 -5
- data/lib/solusvm/cli/node_cli.rb +3 -5
- data/lib/solusvm/cli/reseller_cli.rb +3 -5
- data/lib/solusvm/cli/server_cli.rb +4 -6
- data/lib/solusvm/client.rb +45 -27
- data/lib/solusvm/errors.rb +3 -0
- data/lib/solusvm/general.rb +11 -12
- data/lib/solusvm/hash.rb +1 -11
- data/lib/solusvm/node.rb +33 -21
- data/lib/solusvm/reseller.rb +53 -49
- data/lib/solusvm/server.rb +188 -52
- data/lib/solusvm/version.rb +2 -2
- data/test/cli/test_base_cli.rb +14 -4
- data/test/cli/test_client_cli.rb +13 -13
- data/test/cli/test_general_cli.rb +7 -7
- data/test/cli/test_node_cli.rb +13 -13
- data/test/cli/test_reseller_cli.rb +11 -11
- data/test/cli/test_server_cli.rb +61 -61
- data/test/sham_rack_stubs/base/parse-response.json +4 -0
- data/test/sham_rack_stubs/client/authenticate.json +4 -0
- data/test/sham_rack_stubs/client/change-password.json +6 -0
- data/test/sham_rack_stubs/client/create.json +9 -0
- data/test/sham_rack_stubs/client/delete.json +4 -0
- data/test/sham_rack_stubs/client/exists.json +4 -0
- data/test/sham_rack_stubs/client/list-empty.json +5 -0
- data/test/sham_rack_stubs/client/list.json +30 -0
- data/test/sham_rack_stubs/general/isos-empty.json +5 -0
- data/test/sham_rack_stubs/general/isos.json +5 -0
- data/test/sham_rack_stubs/general/plans-empty.json +5 -0
- data/test/sham_rack_stubs/general/plans.json +5 -0
- data/test/sham_rack_stubs/general/templates-empty.json +7 -0
- data/test/sham_rack_stubs/general/templates.json +7 -0
- data/test/sham_rack_stubs/generic/error.json +4 -0
- data/test/sham_rack_stubs/node/available-ips-empty.json +6 -0
- data/test/sham_rack_stubs/node/available-ips.json +6 -0
- data/test/sham_rack_stubs/node/ids.json +5 -0
- data/test/sham_rack_stubs/node/list-empty.json +5 -0
- data/test/sham_rack_stubs/node/list-groups.json +5 -0
- data/test/sham_rack_stubs/node/list.json +5 -0
- data/test/sham_rack_stubs/node/statistics.json +21 -0
- data/test/sham_rack_stubs/node/virtualservers-empty.json +5 -0
- data/test/sham_rack_stubs/node/virtualservers.json +19 -0
- data/test/sham_rack_stubs/node/xenresources.json +6 -0
- data/test/sham_rack_stubs/reseller/change-resources.json +18 -0
- data/test/sham_rack_stubs/reseller/create.json +25 -0
- data/test/sham_rack_stubs/reseller/delete.json +4 -0
- data/test/sham_rack_stubs/reseller/info.json +24 -0
- data/test/sham_rack_stubs/reseller/list-empty.json +5 -0
- data/test/sham_rack_stubs/reseller/list.json +5 -0
- data/test/sham_rack_stubs/server/add-ip.json +5 -0
- data/test/sham_rack_stubs/server/boot.json +4 -0
- data/test/sham_rack_stubs/server/change-bootorder.json +4 -0
- data/test/sham_rack_stubs/server/change-hostname.json +5 -0
- data/test/sham_rack_stubs/server/change-owner.json +4 -0
- data/test/sham_rack_stubs/server/change-plan.json +4 -0
- data/test/sham_rack_stubs/server/change-rootpassword.json +5 -0
- data/test/sham_rack_stubs/server/change-vncpass.json +5 -0
- data/test/sham_rack_stubs/server/console.json +13 -0
- data/test/sham_rack_stubs/server/create.json +13 -0
- data/test/sham_rack_stubs/server/del-ip.json +4 -0
- data/test/sham_rack_stubs/server/exists.json +4 -0
- data/test/sham_rack_stubs/server/info-all.json +16 -0
- data/test/sham_rack_stubs/server/info.json +15 -0
- data/test/sham_rack_stubs/server/mountiso.json +4 -0
- data/test/sham_rack_stubs/server/network-disable.json +4 -0
- data/test/sham_rack_stubs/server/network-enable.json +4 -0
- data/test/sham_rack_stubs/server/pae-disable.json +4 -0
- data/test/sham_rack_stubs/server/pae-enable.json +4 -0
- data/test/sham_rack_stubs/server/reboot.json +4 -0
- data/test/sham_rack_stubs/server/rebuild.json +4 -0
- data/test/sham_rack_stubs/server/resume.json +4 -0
- data/test/sham_rack_stubs/server/shutdown.json +4 -0
- data/test/sham_rack_stubs/server/status.json +4 -0
- data/test/sham_rack_stubs/server/suspend.json +4 -0
- data/test/sham_rack_stubs/server/terminate.json +4 -0
- data/test/sham_rack_stubs/server/tun-disable.json +4 -0
- data/test/sham_rack_stubs/server/tun-enable.json +4 -0
- data/test/sham_rack_stubs/server/unmountiso.json +4 -0
- data/test/sham_rack_stubs/server/vnc.json +8 -0
- data/test/solusvm/test_base.rb +34 -56
- data/test/solusvm/test_cli.rb +3 -3
- data/test/solusvm/test_client.rb +56 -66
- data/test/solusvm/test_general.rb +34 -19
- data/test/solusvm/test_hash.rb +0 -9
- data/test/solusvm/test_node.rb +66 -72
- data/test/solusvm/test_reseller.rb +47 -58
- data/test/solusvm/test_server.rb +149 -164
- data/test/test_helper.rb +43 -31
- metadata +173 -189
- data/.document +0 -5
- data/.gitignore +0 -25
- data/.travis.yml +0 -12
- data/solusvm.gemspec +0 -33
- data/test/vcr_cassettes/base/invalid_key.yml +0 -19
- data/test/vcr_cassettes/base/invalid_status.yml +0 -19
- data/test/vcr_cassettes/base/nonexistent_node.yml +0 -19
- data/test/vcr_cassettes/base/parse_response.yml +0 -28
- data/test/vcr_cassettes/base/statusmsg.yml +0 -28
- data/test/vcr_cassettes/base/successful.yml +0 -68
- data/test/vcr_cassettes/base/successful_instance_config.yml +0 -28
- data/test/vcr_cassettes/base/unauthorized_ip.yml +0 -19
- data/test/vcr_cassettes/client/authenticate.yml +0 -37
- data/test/vcr_cassettes/client/change_password.yml +0 -39
- data/test/vcr_cassettes/client/create.yml +0 -42
- data/test/vcr_cassettes/client/delete.yml +0 -37
- data/test/vcr_cassettes/client/exists.yml +0 -20
- data/test/vcr_cassettes/client/list.yml +0 -66
- data/test/vcr_cassettes/general/isos.yml +0 -38
- data/test/vcr_cassettes/general/plans.yml +0 -38
- data/test/vcr_cassettes/general/templates.yml +0 -38
- data/test/vcr_cassettes/node/available_ips.yml +0 -41
- data/test/vcr_cassettes/node/ids.yml +0 -21
- data/test/vcr_cassettes/node/list.yml +0 -38
- data/test/vcr_cassettes/node/list_groups.yml +0 -20
- data/test/vcr_cassettes/node/statistics.yml +0 -32
- data/test/vcr_cassettes/node/virtualservers.yml +0 -67
- data/test/vcr_cassettes/node/xenresources.yml +0 -22
- data/test/vcr_cassettes/reseller/change_resources.yml +0 -27
- data/test/vcr_cassettes/reseller/create.yml +0 -27
- data/test/vcr_cassettes/reseller/delete.yml +0 -15
- data/test/vcr_cassettes/reseller/info.yml +0 -27
- data/test/vcr_cassettes/reseller/list.yml +0 -27
- data/test/vcr_cassettes/server/.yml +0 -1017
- data/test/vcr_cassettes/server/add_ip.yml +0 -15
- data/test/vcr_cassettes/server/boot.yml +0 -15
- data/test/vcr_cassettes/server/change_bootorder.yml +0 -15
- data/test/vcr_cassettes/server/change_consolepass.yml +0 -16
- data/test/vcr_cassettes/server/change_hostname.yml +0 -15
- data/test/vcr_cassettes/server/change_owner.yml +0 -15
- data/test/vcr_cassettes/server/change_plan.yml +0 -15
- data/test/vcr_cassettes/server/change_rootpassword.yml +0 -15
- data/test/vcr_cassettes/server/change_vncpass.yml +0 -15
- data/test/vcr_cassettes/server/console.yml +0 -28
- data/test/vcr_cassettes/server/create.yml +0 -27
- data/test/vcr_cassettes/server/del_ip.yml +0 -15
- data/test/vcr_cassettes/server/exists.yml +0 -15
- data/test/vcr_cassettes/server/info.yml +0 -27
- data/test/vcr_cassettes/server/info_all.yml +0 -15
- data/test/vcr_cassettes/server/mountiso.yml +0 -15
- data/test/vcr_cassettes/server/network_disable.yml +0 -15
- data/test/vcr_cassettes/server/network_enable.yml +0 -15
- data/test/vcr_cassettes/server/pae_disable.yml +0 -15
- data/test/vcr_cassettes/server/pae_enable.yml +0 -15
- data/test/vcr_cassettes/server/reboot.yml +0 -15
- data/test/vcr_cassettes/server/rebuild.yml +0 -15
- data/test/vcr_cassettes/server/resume.yml +0 -15
- data/test/vcr_cassettes/server/shutdown.yml +0 -15
- data/test/vcr_cassettes/server/status.yml +0 -15
- data/test/vcr_cassettes/server/suspend.yml +0 -15
- data/test/vcr_cassettes/server/terminate.yml +0 -27
- data/test/vcr_cassettes/server/tun_disable.yml +0 -15
- data/test/vcr_cassettes/server/tun_enable.yml +0 -15
- data/test/vcr_cassettes/server/unmountiso.yml +0 -15
- data/test/vcr_cassettes/server/vnc.yml +0 -15
data/test/solusvm/test_base.rb
CHANGED
@@ -1,53 +1,37 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class TestBase < Test::Unit::TestCase
|
4
|
-
|
5
4
|
def setup
|
6
|
-
@base =
|
5
|
+
@base = SolusVM::Base.new(solusvm_params)
|
7
6
|
end
|
8
7
|
|
9
8
|
def test_valid_server_types
|
10
|
-
assert_equal 3,
|
11
|
-
assert_equal ['openvz', 'xen', 'xen hvm'].sort,
|
9
|
+
assert_equal 3, SolusVM::Base::VALID_SERVER_TYPES.size
|
10
|
+
assert_equal ['openvz', 'xen', 'xen hvm'].sort, SolusVM::Base::VALID_SERVER_TYPES.sort
|
12
11
|
end
|
13
12
|
|
14
13
|
def test_parse_response
|
15
14
|
assert_nil @base.returned_parameters
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
assert_equal '100', params['vserverid']
|
25
|
-
assert_equal 'Virtual server created', params['statusmsg']
|
26
|
-
assert_equal 'vm101|101', params['virtid']
|
27
|
-
assert_equal '123456', params['consolepassword']
|
28
|
-
assert_equal '122.122.122.122,111.111.111.111', params['extraipaddress']
|
29
|
-
assert_equal 'server.hostname.com', params['hostname']
|
30
|
-
assert_equal '123456', params['rootpassword']
|
31
|
-
assert_equal 'success', params['status']
|
15
|
+
|
16
|
+
stub_response 'base/parse-response'
|
17
|
+
|
18
|
+
assert @base.perform_request(action: 'test', vserverid: 1)
|
19
|
+
|
20
|
+
res = @base.returned_parameters
|
21
|
+
assert res.is_a? Hash
|
22
|
+
assert_not_empty res
|
32
23
|
end
|
33
24
|
|
34
25
|
def test_successful
|
35
|
-
|
36
|
-
@base.perform_request(action: 'testsuccess', vserverid: 1)
|
37
|
-
assert @base.successful?
|
26
|
+
stub_response 'base/parse-response'
|
38
27
|
|
39
|
-
|
40
|
-
|
28
|
+
@base.perform_request(action: 'testsuccess', vserverid: 1)
|
29
|
+
assert @base.successful?
|
41
30
|
|
42
|
-
|
43
|
-
assert @base.successful?
|
44
|
-
end
|
31
|
+
stub_response 'generic/error'
|
45
32
|
|
46
|
-
|
47
|
-
|
48
|
-
@base.perform_request(action: 'testconfig', vserverid: 1)
|
49
|
-
assert @base.successful?
|
50
|
-
end
|
33
|
+
@base.perform_request(action: 'testsuccess', vserverid: 1)
|
34
|
+
assert !@base.successful?
|
51
35
|
end
|
52
36
|
|
53
37
|
def test_api_login
|
@@ -55,14 +39,14 @@ class TestBase < Test::Unit::TestCase
|
|
55
39
|
end
|
56
40
|
|
57
41
|
def test_statusmsg
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
assert_equal '
|
42
|
+
stub_response 'base/parse-response'
|
43
|
+
|
44
|
+
assert @base.perform_request(action: 'testsuccess')
|
45
|
+
assert_equal 'The status message', @base.statusmsg
|
62
46
|
end
|
63
47
|
|
64
48
|
def test_validate_server_type
|
65
|
-
|
49
|
+
SolusVM::Base::VALID_SERVER_TYPES.each do |type|
|
66
50
|
assert @base.validate_server_type(type) { true }
|
67
51
|
end
|
68
52
|
|
@@ -72,38 +56,32 @@ class TestBase < Test::Unit::TestCase
|
|
72
56
|
end
|
73
57
|
|
74
58
|
def test_unautorized_ip
|
75
|
-
|
76
|
-
@base.perform_request(action: 'unauthorized')
|
59
|
+
setup_sham_rack { "Invalid ipaddress" }
|
77
60
|
|
78
|
-
|
79
|
-
|
61
|
+
assert_raise SolusVM::AuthenticationError do
|
62
|
+
assert !@base.perform_request(action: 'unauthorized')
|
80
63
|
end
|
81
64
|
end
|
82
65
|
|
83
66
|
def test_invalid_key_or_id
|
84
|
-
|
85
|
-
@base.perform_request(action: 'badkey')
|
67
|
+
setup_sham_rack { "Invalid id or key" }
|
86
68
|
|
87
|
-
|
88
|
-
|
69
|
+
assert_raise SolusVM::AuthenticationError do
|
70
|
+
assert !@base.perform_request(action: 'badkey')
|
89
71
|
end
|
90
72
|
end
|
91
73
|
|
92
74
|
def test_node_does_not_exist
|
93
|
-
|
94
|
-
@base.perform_request(action: 'nodeexist')
|
75
|
+
setup_sham_rack { "Node not found" }
|
95
76
|
|
96
|
-
|
97
|
-
|
98
|
-
end
|
77
|
+
assert !@base.perform_request(action: 'nodeexist')
|
78
|
+
assert_equal "Node does not exist", @base.statusmsg
|
99
79
|
end
|
100
80
|
|
101
81
|
def test_invalid_http_status
|
102
|
-
|
103
|
-
@base.perform_request(action: 'httperror')
|
82
|
+
setup_sham_rack { status 404 }
|
104
83
|
|
105
|
-
|
106
|
-
|
107
|
-
end
|
84
|
+
assert !@base.perform_request(action: 'httperror')
|
85
|
+
assert_equal "Bad HTTP Status: 404", @base.statusmsg
|
108
86
|
end
|
109
87
|
end
|
data/test/solusvm/test_cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require 'solusvm/cli'
|
3
3
|
|
4
|
-
class
|
4
|
+
class TestCLI < Test::Unit::TestCase
|
5
5
|
|
6
6
|
def setup
|
7
7
|
# Prevents mocha from stubbing non existent methods so that we now if the CLI is failing because
|
@@ -10,8 +10,8 @@ class TestCli < Test::Unit::TestCase
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def test_should_print_version
|
13
|
-
$stdout.expects(:puts).with(
|
14
|
-
|
13
|
+
$stdout.expects(:puts).with(SolusVM::VERSION)
|
14
|
+
SolusVM::CLI.start %W(version)
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
data/test/solusvm/test_client.rb
CHANGED
@@ -1,108 +1,98 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
class TestClient < Test::Unit::TestCase
|
4
|
-
|
5
4
|
def setup
|
6
|
-
@client =
|
5
|
+
@client = SolusVM::Client.new(solusvm_params)
|
7
6
|
end
|
8
7
|
|
9
8
|
def test_create
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
9
|
+
stub_response 'client/create'
|
10
|
+
|
11
|
+
options = {
|
12
|
+
username: 'vps123',
|
13
|
+
password: '123456',
|
14
|
+
email: 'email@address.com',
|
15
|
+
firstname: 'phill',
|
16
|
+
lastname: 'smith'
|
17
|
+
}
|
18
|
+
|
19
|
+
assert @client.create(options).is_a? Hash
|
20
|
+
assert @client.successful?
|
22
21
|
end
|
23
22
|
|
24
23
|
def test_create_fail
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
assert_equal 'Empty username field', @client.statusmsg
|
24
|
+
stub_response 'generic/error'
|
25
|
+
|
26
|
+
assert !@client.create
|
29
27
|
end
|
30
28
|
|
31
29
|
def test_exists
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
stub_response 'client/exists'
|
31
|
+
|
32
|
+
assert @client.exists?("vps123")
|
33
|
+
assert @client.successful?
|
36
34
|
end
|
37
35
|
|
38
36
|
def test_change_password
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
stub_response 'client/change-password'
|
38
|
+
|
39
|
+
assert @client.change_password("vps123","123456")
|
40
|
+
assert @client.successful?
|
42
41
|
end
|
43
42
|
|
44
43
|
def test_change_password_fail
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
stub_response 'generic/error'
|
45
|
+
|
46
|
+
assert !@client.change_password("vps13","thecake")
|
48
47
|
end
|
49
48
|
|
50
49
|
def test_authenticate
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
stub_response 'client/authenticate'
|
51
|
+
|
52
|
+
assert @client.authenticate('u', 'p')
|
53
|
+
assert @client.successful?
|
54
54
|
end
|
55
55
|
|
56
56
|
def test_authenticate_fail
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
assert_equal 'invalid username or password', @client.statusmsg
|
57
|
+
stub_response 'generic/error'
|
58
|
+
|
59
|
+
assert !@client.authenticate('u', 'notp')
|
61
60
|
end
|
62
61
|
|
63
62
|
def test_delete
|
64
|
-
|
65
|
-
|
66
|
-
|
63
|
+
stub_response 'client/delete'
|
64
|
+
|
65
|
+
assert @client.delete("vps123")
|
66
|
+
assert @client.successful?
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_delete_fail
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
stub_response 'generic/error'
|
71
|
+
|
72
|
+
assert !@client.delete("novps")
|
73
73
|
end
|
74
74
|
|
75
75
|
def test_list
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
assert_equal "1", client["id"]
|
84
|
-
assert_equal "vps123", client["username"]
|
85
|
-
assert_equal "vps123@email.com", client["email"]
|
86
|
-
assert_equal "phill", client["firstname"]
|
87
|
-
assert_equal "smith", client["lastname"]
|
88
|
-
assert_equal "VPS Co", client["company"]
|
89
|
-
assert_equal "Client", client["level"]
|
90
|
-
assert_equal "Active", client["status"]
|
91
|
-
assert_equal "2009-01-01", client["created"]
|
92
|
-
assert_equal "2010-04-23", client["lastlogin"]
|
76
|
+
stub_response 'client/list'
|
77
|
+
|
78
|
+
list = @client.list
|
79
|
+
|
80
|
+
assert list.is_a? Array
|
81
|
+
assert_not_empty list
|
93
82
|
end
|
94
83
|
|
95
84
|
def test_list_empty
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
85
|
+
stub_response 'client/list-empty'
|
86
|
+
|
87
|
+
list = @client.list
|
88
|
+
|
89
|
+
assert list.is_a? Array
|
90
|
+
assert_empty @client.list
|
100
91
|
end
|
101
92
|
|
102
93
|
def test_list_fail
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
end
|
94
|
+
stub_response 'generic/error'
|
95
|
+
|
96
|
+
assert_nil @client.list
|
107
97
|
end
|
108
98
|
end
|
@@ -2,20 +2,25 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class TestGeneral < Test::Unit::TestCase
|
4
4
|
def setup
|
5
|
-
@general =
|
5
|
+
@general = SolusVM::General.new(solusvm_params)
|
6
6
|
end
|
7
7
|
|
8
8
|
def test_templates
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
stub_response 'general/templates'
|
10
|
+
|
11
|
+
list = @general.templates('xen')
|
12
|
+
|
13
|
+
assert list.is_a? Array
|
14
|
+
assert_not_empty list
|
15
|
+
assert @general.successful?
|
12
16
|
end
|
13
17
|
|
14
18
|
# TODO: Refactor so that the lib is not validating server types
|
15
19
|
def test_templates_empty
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
stub_response 'general/templates-empty'
|
21
|
+
|
22
|
+
assert !@general.templates('xen')
|
23
|
+
assert @general.successful?
|
19
24
|
end
|
20
25
|
|
21
26
|
def test_templates_with_invalid_type
|
@@ -23,15 +28,20 @@ class TestGeneral < Test::Unit::TestCase
|
|
23
28
|
end
|
24
29
|
|
25
30
|
def test_plans
|
26
|
-
|
27
|
-
|
28
|
-
|
31
|
+
stub_response 'general/plans'
|
32
|
+
|
33
|
+
list = @general.plans('xen')
|
34
|
+
|
35
|
+
assert list.is_a? Array
|
36
|
+
assert_not_empty list
|
37
|
+
assert @general.successful?
|
29
38
|
end
|
30
39
|
|
31
40
|
def test_plans_empty
|
32
|
-
|
33
|
-
|
34
|
-
|
41
|
+
stub_response 'general/plans-empty'
|
42
|
+
|
43
|
+
assert !@general.plans('xen')
|
44
|
+
assert @general.successful?
|
35
45
|
end
|
36
46
|
|
37
47
|
def test_plans_with_invalid_type
|
@@ -39,15 +49,20 @@ class TestGeneral < Test::Unit::TestCase
|
|
39
49
|
end
|
40
50
|
|
41
51
|
def test_isos
|
42
|
-
|
43
|
-
|
44
|
-
|
52
|
+
stub_response 'general/isos'
|
53
|
+
|
54
|
+
list = @general.isos('xen')
|
55
|
+
|
56
|
+
assert list.is_a? Array
|
57
|
+
assert_not_empty list
|
58
|
+
assert @general.successful?
|
45
59
|
end
|
46
60
|
|
47
61
|
def test_isos_empty
|
48
|
-
|
49
|
-
|
50
|
-
|
62
|
+
stub_response 'general/isos-empty'
|
63
|
+
|
64
|
+
assert !@general.isos('xen')
|
65
|
+
assert @general.successful?
|
51
66
|
end
|
52
67
|
|
53
68
|
def test_isos_with_invalid_type
|