ruby-atmos 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +8 -0
- data/README +129 -0
- data/Rakefile +94 -0
- data/lib/atmos/attributes.rb +545 -0
- data/lib/atmos/exceptions.rb +28 -0
- data/lib/atmos/object.rb +263 -0
- data/lib/atmos/parser.rb +110 -0
- data/lib/atmos/request.rb +188 -0
- data/lib/atmos/rest.rb +254 -0
- data/lib/atmos/store.rb +209 -0
- data/lib/atmos/util.rb +40 -0
- data/lib/atmos/version.rb +12 -0
- data/test/credentials.rb +141 -0
- data/test/esutest.rb +499 -0
- data/test/files/SmallImageForTest.iso +0 -0
- data/test/files/dragaf-tiny-from-vsphere.ova +0 -0
- data/test/files/something.txt +1 -0
- data/test/request_test.rb +50 -0
- data/test/suite.rb +9 -0
- data/test/suite_noproxy.rb +12 -0
- data/test/suite_proxy.rb +14 -0
- data/test/test_acl.rb +283 -0
- data/test/test_metadata.rb +162 -0
- data/test/test_object_create.rb +152 -0
- data/test/test_object_misc.rb +80 -0
- data/test/test_object_read.rb +114 -0
- data/test/test_object_update.rb +58 -0
- data/test/test_store.rb +125 -0
- data/test/test_util.rb +58 -0
- metadata +164 -0
data/test/test_util.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'atmos'
|
3
|
+
|
4
|
+
|
5
|
+
class AtmosUtilTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
end
|
9
|
+
|
10
|
+
def teardown
|
11
|
+
$stdout.flush
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_hash2header_nil
|
15
|
+
rv = Atmos::Util.hash2header(nil)
|
16
|
+
assert_nil(rv)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_hash2header_empty
|
20
|
+
rv = Atmos::Util.hash2header({})
|
21
|
+
assert_equal("", rv)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_hash2header_bad_input_type
|
25
|
+
assert_raise Atmos::Exceptions::ArgumentException do
|
26
|
+
Atmos::Util.hash2header([])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_hash2header
|
31
|
+
# input = {:a=>:b, :x=>:y, 1=>1}
|
32
|
+
# rv = Atmos::Util.hash2header(input)
|
33
|
+
# assert_equal("a=b, x=y, 1=1", rv)
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_header2hash_nil
|
37
|
+
rv = Atmos::Util.header2hash(nil)
|
38
|
+
assert_nil(rv)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_header2hash_empty
|
42
|
+
rv = Atmos::Util.header2hash("")
|
43
|
+
assert_equal({}, rv)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_header2hash_bad_input_type
|
47
|
+
assert_raise Atmos::Exceptions::ArgumentException do
|
48
|
+
Atmos::Util.header2hash([])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_header2hash
|
53
|
+
input = "a=b, x=y, 1=1"
|
54
|
+
rv = Atmos::Util.header2hash(input)
|
55
|
+
assert_equal({'a'=>'b', 'x'=>'y', '1'=>'1'}, rv)
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ruby-atmos
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Fleur Dragan
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-12-14 00:00:00 -08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: log4r
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 1
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 1
|
33
|
+
- 9
|
34
|
+
version: 1.1.9
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: ruby-hmac
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 15
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 4
|
49
|
+
- 0
|
50
|
+
version: 0.4.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: nokogiri
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 15
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 4
|
65
|
+
- 4
|
66
|
+
version: 1.4.4
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
69
|
+
description: Ruby OO library to access an EMC Atmos server with nokogiri as XML parser.
|
70
|
+
email: fleur.dragan@emc.com
|
71
|
+
executables: []
|
72
|
+
|
73
|
+
extensions: []
|
74
|
+
|
75
|
+
extra_rdoc_files:
|
76
|
+
- README
|
77
|
+
- COPYING
|
78
|
+
files:
|
79
|
+
- Rakefile
|
80
|
+
- lib/atmos/attributes.rb
|
81
|
+
- lib/atmos/exceptions.rb
|
82
|
+
- lib/atmos/object.rb
|
83
|
+
- lib/atmos/parser.rb
|
84
|
+
- lib/atmos/request.rb
|
85
|
+
- lib/atmos/rest.rb
|
86
|
+
- lib/atmos/store.rb
|
87
|
+
- lib/atmos/util.rb
|
88
|
+
- lib/atmos/version.rb
|
89
|
+
- test/credentials.rb
|
90
|
+
- test/esutest.rb
|
91
|
+
- test/files/dragaf-tiny-from-vsphere.ova
|
92
|
+
- test/files/SmallImageForTest.iso
|
93
|
+
- test/files/something.txt
|
94
|
+
- test/request_test.rb
|
95
|
+
- test/suite.rb
|
96
|
+
- test/suite_noproxy.rb
|
97
|
+
- test/suite_proxy.rb
|
98
|
+
- test/test_acl.rb
|
99
|
+
- test/test_metadata.rb
|
100
|
+
- test/test_object_create.rb
|
101
|
+
- test/test_object_misc.rb
|
102
|
+
- test/test_object_read.rb
|
103
|
+
- test/test_object_update.rb
|
104
|
+
- test/test_store.rb
|
105
|
+
- test/test_util.rb
|
106
|
+
- README
|
107
|
+
- COPYING
|
108
|
+
has_rdoc: true
|
109
|
+
homepage: http://www.emc.com/atmos
|
110
|
+
licenses: []
|
111
|
+
|
112
|
+
post_install_message:
|
113
|
+
rdoc_options:
|
114
|
+
- --title
|
115
|
+
- EMC Atmos' REST API gem - ruby-atmos
|
116
|
+
- --main
|
117
|
+
- README
|
118
|
+
- --line-numbers
|
119
|
+
- --inline-source
|
120
|
+
require_paths:
|
121
|
+
- lib
|
122
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
hash: 3
|
128
|
+
segments:
|
129
|
+
- 0
|
130
|
+
version: "0"
|
131
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
133
|
+
requirements:
|
134
|
+
- - ">="
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
hash: 3
|
137
|
+
segments:
|
138
|
+
- 0
|
139
|
+
version: "0"
|
140
|
+
requirements: []
|
141
|
+
|
142
|
+
rubyforge_project: ruby-atmos
|
143
|
+
rubygems_version: 1.3.7
|
144
|
+
signing_key:
|
145
|
+
specification_version: 3
|
146
|
+
summary: Client library for EMC's Atmos REST API
|
147
|
+
test_files:
|
148
|
+
- test/credentials.rb
|
149
|
+
- test/esutest.rb
|
150
|
+
- test/files/dragaf-tiny-from-vsphere.ova
|
151
|
+
- test/files/SmallImageForTest.iso
|
152
|
+
- test/files/something.txt
|
153
|
+
- test/request_test.rb
|
154
|
+
- test/suite.rb
|
155
|
+
- test/suite_noproxy.rb
|
156
|
+
- test/suite_proxy.rb
|
157
|
+
- test/test_acl.rb
|
158
|
+
- test/test_metadata.rb
|
159
|
+
- test/test_object_create.rb
|
160
|
+
- test/test_object_misc.rb
|
161
|
+
- test/test_object_read.rb
|
162
|
+
- test/test_object_update.rb
|
163
|
+
- test/test_store.rb
|
164
|
+
- test/test_util.rb
|