Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit ee897d6

Browse files
committed
Update qa tests with data version selection
1 parent afd01e8 commit ee897d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+525
-113
lines changed

core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030

3131
const (
3232
// VERSION - current version
33-
VERSION = "0.13.6"
33+
VERSION = "0.14.0"
3434
// USERAGENT - user-agent header string
3535
USERAGENT = "/openbazaar-go:" + VERSION + "/"
3636
)

qa/cancel_direct_offline.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def run_test(self):
3030
time.sleep(20)
3131

3232
# post profile for alice
33-
with open('testdata/profile.json') as profile_file:
33+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
3434
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
3535
api_url = alice["gateway_url"] + "ob/profile"
3636
requests.post(api_url, data=json.dumps(profile_json, indent=4))
3737

3838
# post listing to alice
39-
with open('testdata/listing.json') as listing_file:
39+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
4040
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4141
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
4242
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -67,7 +67,7 @@ def run_test(self):
6767
time.sleep(4)
6868

6969
# bob send order
70-
with open('testdata/order_direct.json') as order_file:
70+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
7171
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
7272
order_json["items"][0]["listingHash"] = listingId
7373
order_json["paymentCoin"] = "T" + self.cointype

qa/complete_direct_online.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ def run_test(self):
3030
time.sleep(20)
3131

3232
# post profile for alice
33-
with open('testdata/profile.json') as profile_file:
33+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
3434
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
3535
api_url = alice["gateway_url"] + "ob/profile"
3636
requests.post(api_url, data=json.dumps(profile_json, indent=4))
3737

3838
# post listing to alice
39-
with open('testdata/listing.json') as listing_file:
39+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
4040
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4141
listing_json["item"]["priceCurrency"]["code"] = "T" + self.cointype
4242
listing_json["metadata"]["acceptedCurrencies"] = ["T" + self.cointype]
@@ -60,7 +60,7 @@ def run_test(self):
6060
listingId = resp[0]["hash"]
6161

6262
# bob send order
63-
with open('testdata/order_direct.json') as order_file:
63+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
6464
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
6565
order_json["items"][0]["listingHash"] = listingId
6666
order_json["paymentCoin"] = "t" + self.cointype
@@ -138,7 +138,7 @@ def run_test(self):
138138
raise TestFailure("CompleteDirectOnlineTest - FAIL: Alice incorrectly saved as unfunded")
139139

140140
# alice send order fulfillment
141-
with open('testdata/fulfillment.json') as fulfillment_file:
141+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
142142
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
143143
fulfillment_json["orderId"] = orderId
144144
fulfillment_json["slug"] = slug

qa/complete_disputed.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_test(self):
4343
time.sleep(4)
4444

4545
# make charlie a moderator
46-
with open('testdata/moderation.json') as listing_file:
46+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4747
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4848
api_url = charlie["gateway_url"] + "ob/moderator"
4949
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -56,13 +56,13 @@ def run_test(self):
5656
time.sleep(4)
5757

5858
# post profile for alice
59-
with open('testdata/profile.json') as profile_file:
59+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
6060
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6161
api_url = alice["gateway_url"] + "ob/profile"
6262
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6363

6464
# post listing to alice
65-
with open('testdata/listing.json') as listing_file:
65+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6666
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6767
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6868
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -87,7 +87,7 @@ def run_test(self):
8787
listingId = resp[0]["hash"]
8888

8989
# bob send order
90-
with open('testdata/order_direct.json') as order_file:
90+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9191
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9292
order_json["items"][0]["listingHash"] = listingId
9393
order_json["moderator"] = moderatorId
@@ -167,7 +167,7 @@ def run_test(self):
167167
raise TestFailure("CompleteDisputedTest - FAIL: Alice incorrectly saved as unfunded")
168168

169169
# alice send order fulfillment
170-
with open('testdata/fulfillment.json') as fulfillment_file:
170+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
171171
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
172172
fulfillment_json["orderId"] = orderId
173173
fulfillment_json["slug"] = slug

qa/complete_moderated_online.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_test(self):
4242
time.sleep(4)
4343

4444
# make charlie a moderator
45-
with open('testdata/moderation.json') as listing_file:
45+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4646
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4747
api_url = charlie["gateway_url"] + "ob/moderator"
4848
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -55,13 +55,13 @@ def run_test(self):
5555
time.sleep(4)
5656

5757
# post profile for alice
58-
with open('testdata/profile.json') as profile_file:
58+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
5959
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6060
api_url = alice["gateway_url"] + "ob/profile"
6161
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6262

6363
# post listing to alice
64-
with open('testdata/listing.json') as listing_file:
64+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6565
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6666
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6767
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -87,7 +87,7 @@ def run_test(self):
8787
listingId = resp[0]["hash"]
8888

8989
# bob send order
90-
with open('testdata/order_direct.json') as order_file:
90+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9191
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9292
order_json["items"][0]["listingHash"] = listingId
9393
order_json["moderator"] = moderatorId
@@ -167,7 +167,7 @@ def run_test(self):
167167
raise TestFailure("CompleteModeratedOnlineTest - FAIL: Alice incorrectly saved as unfunded")
168168

169169
# alice send order fulfillment
170-
with open('testdata/fulfillment.json') as fulfillment_file:
170+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
171171
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
172172
fulfillment_json["slug"] = slug
173173
fulfillment_json["orderId"] = orderId
@@ -199,7 +199,7 @@ def run_test(self):
199199
raise TestFailure("CompleteModeratedOnlineTest - FAIL: Alice failed to order fulfillment")
200200

201201
# bob send order completion
202-
with open('testdata/completion.json') as completion_file:
202+
with open('testdata/'+ self.buyer_version +'/completion.json') as completion_file:
203203
completion_json = json.load(completion_file, object_pairs_hook=OrderedDict)
204204
completion_json["orderId"] = orderId
205205
completion_json["ratings"][0]["slug"] = slug

qa/complete_moderated_with_timeout.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_test(self):
4242
time.sleep(4)
4343

4444
# make charlie a moderator
45-
with open('testdata/moderation.json') as listing_file:
45+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4646
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4747
api_url = charlie["gateway_url"] + "ob/moderator"
4848
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -55,13 +55,13 @@ def run_test(self):
5555
time.sleep(4)
5656

5757
# post profile for alice
58-
with open('testdata/profile.json') as profile_file:
58+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
5959
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6060
api_url = alice["gateway_url"] + "ob/profile"
6161
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6262

6363
# post listing to alice
64-
with open('testdata/listing.json') as listing_file:
64+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6565
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6666
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6767
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -88,7 +88,7 @@ def run_test(self):
8888
listingId = resp[0]["hash"]
8989

9090
# bob send order
91-
with open('testdata/order_direct.json') as order_file:
91+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9292
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9393
order_json["items"][0]["listingHash"] = listingId
9494
order_json["moderator"] = moderatorId
@@ -168,7 +168,7 @@ def run_test(self):
168168
raise TestFailure("CompleteModeratedWithTimeout - FAIL: Alice incorrectly saved as unfunded")
169169

170170
# alice send order fulfillment
171-
with open('testdata/fulfillment.json') as fulfillment_file:
171+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
172172
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
173173
fulfillment_json["slug"] = slug
174174
fulfillment_json["orderId"] = orderId
@@ -200,7 +200,7 @@ def run_test(self):
200200
raise TestFailure("CompleteModeratedWithTimeout - FAIL: Alice failed to order fulfillment")
201201

202202
# bob send order completion
203-
with open('testdata/completion.json') as completion_file:
203+
with open('testdata/'+ self.buyer_version +'/completion.json') as completion_file:
204204
completion_json = json.load(completion_file, object_pairs_hook=OrderedDict)
205205
completion_json["orderId"] = orderId
206206
completion_json["ratings"][0]["slug"] = slug

qa/dispute_close_buyer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_test(self):
4343
time.sleep(4)
4444

4545
# make charlie a moderator
46-
with open('testdata/moderation.json') as listing_file:
46+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4747
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4848
api_url = charlie["gateway_url"] + "ob/moderator"
4949
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -56,13 +56,13 @@ def run_test(self):
5656
time.sleep(4)
5757

5858
# post profile for alice
59-
with open('testdata/profile.json') as profile_file:
59+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
6060
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6161
api_url = alice["gateway_url"] + "ob/profile"
6262
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6363

6464
# post listing to alice
65-
with open('testdata/listing.json') as listing_file:
65+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6666
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6767
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6868
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -86,7 +86,7 @@ def run_test(self):
8686
listingId = resp[0]["hash"]
8787

8888
# bob send order
89-
with open('testdata/order_direct.json') as order_file:
89+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9090
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9191
order_json["items"][0]["listingHash"] = listingId
9292
order_json["moderator"] = moderatorId

qa/dispute_close_split.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_test(self):
4343
time.sleep(4)
4444

4545
# make charlie a moderator
46-
with open('testdata/moderation.json') as listing_file:
46+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4747
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4848
api_url = charlie["gateway_url"] + "ob/moderator"
4949
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -56,13 +56,13 @@ def run_test(self):
5656
time.sleep(4)
5757

5858
# post profile for alice
59-
with open('testdata/profile.json') as profile_file:
59+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
6060
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6161
api_url = alice["gateway_url"] + "ob/profile"
6262
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6363

6464
# post listing to alice
65-
with open('testdata/listing.json') as listing_file:
65+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6666
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6767
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6868
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -86,7 +86,7 @@ def run_test(self):
8686
listingId = resp[0]["hash"]
8787

8888
# bob send order
89-
with open('testdata/order_direct.json') as order_file:
89+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9090
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9191
order_json["items"][0]["listingHash"] = listingId
9292
order_json["moderator"] = moderatorId

qa/dispute_close_vendor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run_test(self):
4343
time.sleep(4)
4444

4545
# make charlie a moderator
46-
with open('testdata/moderation.json') as listing_file:
46+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4747
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4848
api_url = charlie["gateway_url"] + "ob/moderator"
4949
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -56,13 +56,13 @@ def run_test(self):
5656
time.sleep(4)
5757

5858
# post profile for alice
59-
with open('testdata/profile.json') as profile_file:
59+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
6060
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6161
api_url = alice["gateway_url"] + "ob/profile"
6262
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6363

6464
# post listing to alice
65-
with open('testdata/listing.json') as listing_file:
65+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6666
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6767
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6868
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -88,7 +88,7 @@ def run_test(self):
8888
listingId = resp[0]["hash"]
8989

9090
# bob send order
91-
with open('testdata/order_direct.json') as order_file:
91+
with open('testdata/'+ self.buyer_version+'/order_direct.json') as order_file:
9292
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9393
order_json["items"][0]["listingHash"] = listingId
9494
order_json["moderator"] = moderatorId
@@ -168,7 +168,7 @@ def run_test(self):
168168
raise TestFailure("DisputeCloseVendorTest - FAIL: Alice incorrectly saved as unfunded")
169169

170170
# alice send order fulfillment
171-
with open('testdata/fulfillment.json') as fulfillment_file:
171+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
172172
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
173173
fulfillment_json["orderId"] = orderId
174174
fulfillment_json["slug"] = slug

qa/escrow_release_after_timeout.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def run_test(self):
4242
time.sleep(4)
4343

4444
# make charlie a moderator
45-
with open('testdata/moderation.json') as listing_file:
45+
with open('testdata/'+ self.moderator_version +'/moderation.json') as listing_file:
4646
moderation_json = json.load(listing_file, object_pairs_hook=OrderedDict)
4747
api_url = charlie["gateway_url"] + "ob/moderator"
4848
r = requests.put(api_url, data=json.dumps(moderation_json, indent=4))
@@ -55,13 +55,13 @@ def run_test(self):
5555
time.sleep(4)
5656

5757
# post profile for alice
58-
with open('testdata/profile.json') as profile_file:
58+
with open('testdata/'+ self.vendor_version +'/profile.json') as profile_file:
5959
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
6060
api_url = alice["gateway_url"] + "ob/profile"
6161
requests.post(api_url, data=json.dumps(profile_json, indent=4))
6262

6363
# post listing to alice
64-
with open('testdata/listing.json') as listing_file:
64+
with open('testdata/'+ self.vendor_version +'/listing.json') as listing_file:
6565
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)
6666
listing_json["item"]["priceCurrency"]["code"] = "t" + self.cointype
6767
listing_json["metadata"]["acceptedCurrencies"] = ["t" + self.cointype]
@@ -88,7 +88,7 @@ def run_test(self):
8888
listingId = resp[0]["hash"]
8989

9090
# bob send order
91-
with open('testdata/order_direct.json') as order_file:
91+
with open('testdata/'+ self.buyer_version +'/order_direct.json') as order_file:
9292
order_json = json.load(order_file, object_pairs_hook=OrderedDict)
9393
order_json["items"][0]["listingHash"] = listingId
9494
order_json["moderator"] = moderatorId
@@ -168,7 +168,7 @@ def run_test(self):
168168
raise TestFailure("EscrowTimeoutRelease - FAIL: Alice incorrectly saved as unfunded")
169169

170170
# alice send order fulfillment
171-
with open('testdata/fulfillment.json') as fulfillment_file:
171+
with open('testdata/'+ self.vendor_version +'/fulfillment.json') as fulfillment_file:
172172
fulfillment_json = json.load(fulfillment_file, object_pairs_hook=OrderedDict)
173173
fulfillment_json["slug"] = slug
174174
fulfillment_json["orderId"] = orderId

0 commit comments

Comments
 (0)