peddler 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 643f86fabcad58eb28dc12df5a89e8d97a4b00bf
|
4
|
+
data.tar.gz: a1ba8e6643a5dbc6590bd7f95f747ccd8526d339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8911ac5bebc89910a544bc5342f88fae07101cac10a6188454fd1625ea6e13b2ff214cc87eb0f29806b94e2dd8e6e272f9043435c7a2596d69d56b11ac0a363
|
7
|
+
data.tar.gz: 5e6f584d46b5310792fbdb24a3984afdd036f46b13266d2251fd67a833fddf87d1678a463aec12b8cc44d6f945f76a2dc37b53852e6134db06893e3358761831
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ To use Amazon MWS, you must have an eligible seller account and register for MWS
|
|
10
10
|
|
11
11
|
Some MWS API sections may require additional authorisation from Amazon.
|
12
12
|
|
13
|
-

|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
data/lib/peddler/version.rb
CHANGED
@@ -10,7 +10,9 @@ module Peddler
|
|
10
10
|
private
|
11
11
|
|
12
12
|
def find_data
|
13
|
-
results = xml.values.first.find { |k, _| k.include?('Result') }
|
13
|
+
results = xml.values.first.find { |k, _| k.include?('Result') } ||
|
14
|
+
xml.values.first.find { |k, _| k == 'Message' }
|
15
|
+
|
14
16
|
results ? results.last : nil
|
15
17
|
end
|
16
18
|
end
|
@@ -158,14 +158,14 @@ class TestMWSFulfillmentInboundShipmentClient < MiniTest::Test
|
|
158
158
|
def test_lists_inbound_shipments
|
159
159
|
operation = {
|
160
160
|
'Action' => 'ListInboundShipments',
|
161
|
-
'ShipmentStatusList.member.1
|
162
|
-
'ShipmentIdList.member.1
|
161
|
+
'ShipmentStatusList.member.1' => 'Foo',
|
162
|
+
'ShipmentIdList.member.1' => 'Bar'
|
163
163
|
}
|
164
164
|
|
165
165
|
@client.stub(:run, nil) do
|
166
166
|
@client.list_inbound_shipments(
|
167
|
-
shipment_status_list: [
|
168
|
-
shipment_id_list: [
|
167
|
+
shipment_status_list: ['Foo'],
|
168
|
+
shipment_id_list: ['Bar'])
|
169
169
|
end
|
170
170
|
|
171
171
|
assert_equal operation, @client.operation
|
@@ -5,18 +5,28 @@ class TestPeddlerXMLResponseParser < MiniTest::Test
|
|
5
5
|
def setup
|
6
6
|
body = '<Response><Result><NextToken>123</NextToken>'\
|
7
7
|
'<Foo>Bar</Foo></Result></Response>'
|
8
|
-
|
8
|
+
|
9
|
+
@parser = Peddler::XMLResponseParser.new(response(body))
|
10
|
+
end
|
11
|
+
|
12
|
+
def response(body)
|
13
|
+
OpenStruct.new(
|
9
14
|
body: body,
|
10
15
|
headers: { 'Content-Type' => 'text/xml', 'Content-Length' => '78' }
|
11
16
|
)
|
12
|
-
|
13
|
-
@parser = Peddler::XMLResponseParser.new(res)
|
14
17
|
end
|
15
18
|
|
16
19
|
def test_parses_data
|
17
20
|
assert_equal 'Bar', @parser.parse['Foo']
|
18
21
|
end
|
19
22
|
|
23
|
+
def test_parses_message_data
|
24
|
+
body_with_message = '<Response><Message><NextToken>123</NextToken>'\
|
25
|
+
'<Foo>Bar</Foo></Message></Response>'
|
26
|
+
parser = Peddler::XMLResponseParser.new(response(body_with_message))
|
27
|
+
assert_equal 'Bar', parser.parse['Foo']
|
28
|
+
end
|
29
|
+
|
20
30
|
def test_next_token
|
21
31
|
assert_equal '123', @parser.next_token
|
22
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: peddler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hakan Ensari
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jeff
|