ruby-aaws 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL +260 -0
- data/NEWS +116 -1
- data/README +13 -7
- data/README.rdoc +12 -10
- data/example/example1 +3 -3
- data/lib/amazon.rb +9 -7
- data/lib/amazon/aws.rb +212 -65
- data/lib/amazon/aws/search.rb +62 -16
- data/test/setup.rb +4 -2
- data/test/tc_aws.rb +2 -2
- data/test/tc_browse_node_lookup.rb +62 -0
- data/test/tc_customer_content_lookup.rb +64 -0
- data/test/tc_help.rb +60 -0
- data/test/tc_item_lookup.rb +60 -0
- data/test/tc_item_search.rb +54 -6
- data/test/tc_list_lookup.rb +55 -0
- data/test/tc_list_search.rb +55 -0
- data/test/tc_multiple_operation.rb +201 -2
- data/test/tc_seller_listing_lookup.rb +58 -0
- data/test/tc_seller_listing_search.rb +70 -0
- data/test/tc_seller_lookup.rb +54 -0
- data/test/tc_similarity_lookup.rb +59 -0
- data/test/tc_tag_lookup.rb +35 -0
- data/test/tc_transaction_lookup.rb +35 -0
- data/test/ts_aws.rb +16 -5
- metadata +29 -3
@@ -0,0 +1,54 @@
|
|
1
|
+
# $Id: tc_seller_lookup.rb,v 1.1 2009/06/03 09:53:02 ianmacd Exp $
|
2
|
+
#
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
require './setup'
|
6
|
+
|
7
|
+
class TestSellerLookup < AWSTest
|
8
|
+
|
9
|
+
def test_seller_lookup
|
10
|
+
|
11
|
+
sl = SellerLookup.new( 'A3QFR0K2KCB7EG' )
|
12
|
+
rg = ResponseGroup.new( 'Seller' )
|
13
|
+
response = @req.search( sl, rg )
|
14
|
+
|
15
|
+
seller = response.kernel
|
16
|
+
|
17
|
+
assert_equal( 'wherehouse', seller.nickname )
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_seller_lookup_no_response_group
|
22
|
+
|
23
|
+
sl = SellerLookup.new( 'A3QFR0K2KCB7EG' )
|
24
|
+
sl.response_group = ResponseGroup.new( :Seller )
|
25
|
+
response = @req.search( sl )
|
26
|
+
|
27
|
+
seller = response.kernel
|
28
|
+
|
29
|
+
assert_equal( 'wherehouse', seller.nickname )
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_seller_lookup_class_method
|
34
|
+
|
35
|
+
response = Amazon::AWS.seller_lookup( 'A3QFR0K2KCB7EG' )
|
36
|
+
|
37
|
+
seller = response.kernel
|
38
|
+
|
39
|
+
assert_equal( 'wherehouse', seller.nickname )
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_seller_lookup_class_method_block
|
44
|
+
|
45
|
+
Amazon::AWS.seller_lookup( 'A3QFR0K2KCB7EG' ) do |r|
|
46
|
+
|
47
|
+
seller = r.kernel
|
48
|
+
|
49
|
+
assert_equal( 'wherehouse', seller.nickname )
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# $Id: tc_similarity_lookup.rb,v 1.1 2009/06/03 10:29:24 ianmacd Exp $
|
2
|
+
#
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
require './setup'
|
6
|
+
|
7
|
+
class TestSimilarityLookup < AWSTest
|
8
|
+
|
9
|
+
def test_similarity_lookup
|
10
|
+
|
11
|
+
sl = SimilarityLookup.new( [ 'B000AE4QEC', 'B000051WBE' ] )
|
12
|
+
rg = ResponseGroup.new( :Subjects )
|
13
|
+
response = @req.search( sl, rg )
|
14
|
+
|
15
|
+
items = response.similarity_lookup_response[0].items
|
16
|
+
|
17
|
+
assert_match( /^\w+/, items.item[0].subjects.subject[0] )
|
18
|
+
assert_match( /^\w+/, items.item[1].subjects.subject[0] )
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_similarity_lookup_no_response_group
|
23
|
+
|
24
|
+
sl = SimilarityLookup.new( [ 'B000AE4QEC', 'B000051WBE' ] )
|
25
|
+
sl.response_group = ResponseGroup.new( :Subjects )
|
26
|
+
response = @req.search( sl, nil )
|
27
|
+
|
28
|
+
items = response.similarity_lookup_response[0].items
|
29
|
+
|
30
|
+
assert_match( /^\w+/, items.item[0].subjects.subject[0] )
|
31
|
+
assert_match( /^\w+/, items.item[1].subjects.subject[0] )
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_similarity_lookup_class_method
|
36
|
+
|
37
|
+
response = Amazon::AWS.similarity_lookup( [ 'B000AE4QEC', 'B000051WBE' ] )
|
38
|
+
|
39
|
+
items = response.similarity_lookup_response[0].items
|
40
|
+
|
41
|
+
assert_match( /^http:/, items.item[0].detail_page_url )
|
42
|
+
assert_match( /^http:/, items.item[1].detail_page_url )
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_item_search_class_method_block
|
47
|
+
|
48
|
+
Amazon::AWS.similarity_lookup( [ 'B000AE4QEC', 'B000051WBE' ] ) do |r|
|
49
|
+
|
50
|
+
items = r.similarity_lookup_response[0].items
|
51
|
+
|
52
|
+
assert_match( /^http:/, items.item[0].detail_page_url )
|
53
|
+
assert_match( /^http:/, items.item[1].detail_page_url )
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# $Id: tc_tag_lookup.rb,v 1.1 2009/06/03 23:20:37 ianmacd Exp $
|
2
|
+
#
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
require './setup'
|
6
|
+
|
7
|
+
class TestTagLookup < AWSTest
|
8
|
+
|
9
|
+
def test_tag_lookup
|
10
|
+
|
11
|
+
@req.locale = 'us'
|
12
|
+
tl = TagLookup.new( 'Awful' )
|
13
|
+
rg = ResponseGroup.new( :Tags, :TagsSummary )
|
14
|
+
response = @req.search( tl, rg )
|
15
|
+
|
16
|
+
tag = response.kernel
|
17
|
+
|
18
|
+
assert_equal( '2005-11-21 16:46:53', tag.first_tagging.time )
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_tag_lookup_no_response_group
|
23
|
+
|
24
|
+
@req.locale = 'us'
|
25
|
+
tl = TagLookup.new( 'Awful' )
|
26
|
+
tl.response_group = ResponseGroup.new( :Tags, :TagsSummary )
|
27
|
+
response = @req.search( tl, nil )
|
28
|
+
|
29
|
+
tag = response.kernel
|
30
|
+
|
31
|
+
assert_equal( '2005-11-21 16:46:53', tag.first_tagging.time )
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# $Id: tc_transaction_lookup.rb,v 1.1 2009/06/03 23:25:33 ianmacd Exp $
|
2
|
+
#
|
3
|
+
|
4
|
+
require 'test/unit'
|
5
|
+
require './setup'
|
6
|
+
|
7
|
+
class TestTransactionLookup < AWSTest
|
8
|
+
|
9
|
+
def test_transaction_lookup
|
10
|
+
|
11
|
+
@req.locale = 'us'
|
12
|
+
tl = TransactionLookup.new( '103-5663398-5028241' )
|
13
|
+
rg = ResponseGroup.new( :TransactionDetails )
|
14
|
+
response = @req.search( tl, rg )
|
15
|
+
|
16
|
+
trans = response.kernel
|
17
|
+
|
18
|
+
assert_equal( '2008-04-13T23:49:38', trans.transaction_date )
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_transaction_lookup_no_response_group
|
23
|
+
|
24
|
+
@req.locale = 'us'
|
25
|
+
tl = TransactionLookup.new( '103-5663398-5028241' )
|
26
|
+
tl.response_group = ResponseGroup.new( :TransactionDetails )
|
27
|
+
response = @req.search( tl, nil )
|
28
|
+
|
29
|
+
trans = response.kernel
|
30
|
+
|
31
|
+
assert_equal( '2008-04-13T23:49:38', trans.transaction_date )
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
data/test/ts_aws.rb
CHANGED
@@ -1,13 +1,24 @@
|
|
1
|
-
# $Id: ts_aws.rb,v 1.
|
1
|
+
# $Id: ts_aws.rb,v 1.17 2009/06/03 23:25:33 ianmacd Exp $
|
2
2
|
#
|
3
3
|
|
4
4
|
require 'test/unit'
|
5
5
|
require 'tc_amazon'
|
6
6
|
require 'tc_aws'
|
7
|
-
require '
|
8
|
-
require '
|
7
|
+
require 'tc_browse_node_lookup'
|
8
|
+
require 'tc_customer_content_lookup'
|
9
|
+
require 'tc_help'
|
10
|
+
require 'tc_item_lookup'
|
9
11
|
require 'tc_item_search'
|
12
|
+
require 'tc_list_lookup'
|
13
|
+
require 'tc_list_search'
|
10
14
|
require 'tc_multiple_operation'
|
11
|
-
require '
|
12
|
-
|
15
|
+
require 'tc_operation_request'
|
16
|
+
require 'tc_seller_listing_lookup'
|
17
|
+
require 'tc_seller_listing_search'
|
18
|
+
require 'tc_seller_lookup'
|
19
|
+
require 'tc_serialisation'
|
20
|
+
require 'tc_similarity_lookup'
|
13
21
|
require 'tc_shopping_cart'
|
22
|
+
require 'tc_tag_lookup'
|
23
|
+
require 'tc_transaction_lookup'
|
24
|
+
require 'tc_vehicle_operations'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-aaws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Macdonald
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-16 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -21,6 +21,7 @@ extensions: []
|
|
21
21
|
|
22
22
|
extra_rdoc_files:
|
23
23
|
- COPYING
|
24
|
+
- INSTALL
|
24
25
|
- NEWS
|
25
26
|
- README
|
26
27
|
- README.rdoc
|
@@ -58,12 +59,25 @@ files:
|
|
58
59
|
- test/tc_item_search.rb
|
59
60
|
- test/tc_aws.rb
|
60
61
|
- test/tc_multiple_operation.rb
|
62
|
+
- test/tc_help.rb
|
61
63
|
- test/tc_operation_request.rb
|
62
64
|
- test/tc_shopping_cart.rb
|
63
65
|
- test/ts_aws.rb
|
64
66
|
- test/tc_serialisation.rb
|
65
67
|
- test/tc_vehicle_operations.rb
|
68
|
+
- test/tc_item_lookup.rb
|
69
|
+
- test/tc_seller_listing_search.rb
|
70
|
+
- test/tc_browse_node_lookup.rb
|
71
|
+
- test/tc_customer_content_lookup.rb
|
72
|
+
- test/tc_list_lookup.rb
|
73
|
+
- test/tc_list_search.rb
|
74
|
+
- test/tc_seller_listing_lookup.rb
|
75
|
+
- test/tc_seller_lookup.rb
|
76
|
+
- test/tc_similarity_lookup.rb
|
77
|
+
- test/tc_tag_lookup.rb
|
78
|
+
- test/tc_transaction_lookup.rb
|
66
79
|
- COPYING
|
80
|
+
- INSTALL
|
67
81
|
- NEWS
|
68
82
|
- README
|
69
83
|
- README.rdoc
|
@@ -78,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
92
|
requirements:
|
79
93
|
- - ">="
|
80
94
|
- !ruby/object:Gem::Version
|
81
|
-
version: 1.8.
|
95
|
+
version: 1.8.7
|
82
96
|
version:
|
83
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
98
|
requirements:
|
@@ -99,8 +113,20 @@ test_files:
|
|
99
113
|
- test/tc_item_search.rb
|
100
114
|
- test/tc_aws.rb
|
101
115
|
- test/tc_multiple_operation.rb
|
116
|
+
- test/tc_help.rb
|
102
117
|
- test/tc_operation_request.rb
|
103
118
|
- test/tc_shopping_cart.rb
|
104
119
|
- test/ts_aws.rb
|
105
120
|
- test/tc_serialisation.rb
|
106
121
|
- test/tc_vehicle_operations.rb
|
122
|
+
- test/tc_item_lookup.rb
|
123
|
+
- test/tc_seller_listing_search.rb
|
124
|
+
- test/tc_browse_node_lookup.rb
|
125
|
+
- test/tc_customer_content_lookup.rb
|
126
|
+
- test/tc_list_lookup.rb
|
127
|
+
- test/tc_list_search.rb
|
128
|
+
- test/tc_seller_listing_lookup.rb
|
129
|
+
- test/tc_seller_lookup.rb
|
130
|
+
- test/tc_similarity_lookup.rb
|
131
|
+
- test/tc_tag_lookup.rb
|
132
|
+
- test/tc_transaction_lookup.rb
|