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

Commit fc000ee

Browse files
authored
Merge pull request #702 from OpenBazaar/qa
Set vendor profile in qa tests
2 parents 51232ff + 3ae48bf commit fc000ee

21 files changed

+125
-0
lines changed

core/core.go

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ type OpenBazaarNode struct {
9898

9999
// Unpin the current node repo, re-add it, then publish to IPNS
100100
var seedLock sync.Mutex
101+
101102
func (n *OpenBazaarNode) SeedNode() error {
102103
seedLock.Lock()
103104
ipfs.UnPinDir(n.Context, n.RootHash)

qa/cancel_direct_offline.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
3238
# post listing to alice
3339
with open('testdata/listing.json') as listing_file:
3440
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/complete_direct_online.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
3238
# post listing to alice
3339
with open('testdata/listing.json') as listing_file:
3440
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/complete_disputed.py

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def run_test(self):
5555
moderatorId = charlie["peerId"]
5656
time.sleep(4)
5757

58+
# post profile for alice
59+
with open('testdata/profile.json') as profile_file:
60+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
61+
api_url = alice["gateway_url"] + "ob/profile"
62+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
63+
5864
# post listing to alice
5965
with open('testdata/listing.json') as listing_file:
6066
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/complete_moderated_online.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/complete_moderated_with_timeout.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/dispute_close_buyer.py

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def run_test(self):
5555
moderatorId = charlie["peerId"]
5656
time.sleep(4)
5757

58+
# post profile for alice
59+
with open('testdata/profile.json') as profile_file:
60+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
61+
api_url = alice["gateway_url"] + "ob/profile"
62+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
63+
5864
# post listing to alice
5965
with open('testdata/listing.json') as listing_file:
6066
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/dispute_close_split.py

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def run_test(self):
5555
moderatorId = charlie["peerId"]
5656
time.sleep(4)
5757

58+
# post profile for alice
59+
with open('testdata/profile.json') as profile_file:
60+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
61+
api_url = alice["gateway_url"] + "ob/profile"
62+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
63+
5864
# post listing to alice
5965
with open('testdata/listing.json') as listing_file:
6066
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/dispute_close_vendor.py

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ def run_test(self):
5555
moderatorId = charlie["peerId"]
5656
time.sleep(4)
5757

58+
# post profile for alice
59+
with open('testdata/profile.json') as profile_file:
60+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
61+
api_url = alice["gateway_url"] + "ob/profile"
62+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
63+
5864
# post listing to alice
5965
with open('testdata/listing.json') as listing_file:
6066
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/escrow_release_after_timeout.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/fulfill_direct_online.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
3238
# post listing to alice
3339
with open('testdata/listing.json') as listing_file:
3440
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/purchase_digital.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
3238
# post listing to alice
3339
with open('testdata/digital.json') as listing_file:
3440
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/purchase_direct_offline.py

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ def run_test(self):
1515
alice = self.nodes[0]
1616
bob = self.nodes[1]
1717

18+
# post profile for alice
19+
with open('testdata/profile.json') as profile_file:
20+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
21+
api_url = alice["gateway_url"] + "ob/profile"
22+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
23+
1824
# post listing to alice
1925
with open('testdata/listing.json') as listing_file:
2026
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/purchase_direct_online.py

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
38+
# post profile for alice
39+
with open('testdata/profile.json') as profile_file:
40+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
41+
api_url = alice["gateway_url"] + "ob/profile"
42+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
43+
3244
# post listing to alice
3345
with open('testdata/listing.json') as listing_file:
3446
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/purchase_moderated_offline.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/purchase_moderated_online.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/refund_direct.py

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def run_test(self):
4343
self.send_bitcoin_cmd("sendtoaddress", address, 10)
4444
time.sleep(20)
4545

46+
# post profile for alice
47+
with open('testdata/profile.json') as profile_file:
48+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
49+
api_url = alice["gateway_url"] + "ob/profile"
50+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
51+
4652
# post listing to alice
4753
with open('testdata/listing.json') as listing_file:
4854
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/refund_moderated.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/reject_direct_offline.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ def run_test(self):
2929
self.send_bitcoin_cmd("sendtoaddress", address, 10)
3030
time.sleep(20)
3131

32+
# post profile for alice
33+
with open('testdata/profile.json') as profile_file:
34+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
35+
api_url = alice["gateway_url"] + "ob/profile"
36+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
37+
3238
# post listing to alice
3339
with open('testdata/listing.json') as listing_file:
3440
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/reject_moderated_offine.py

+6
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ def run_test(self):
5454
moderatorId = charlie["peerId"]
5555
time.sleep(4)
5656

57+
# post profile for alice
58+
with open('testdata/profile.json') as profile_file:
59+
profile_json = json.load(profile_file, object_pairs_hook=OrderedDict)
60+
api_url = alice["gateway_url"] + "ob/profile"
61+
requests.post(api_url, data=json.dumps(profile_json, indent=4))
62+
5763
# post listing to alice
5864
with open('testdata/listing.json') as listing_file:
5965
listing_json = json.load(listing_file, object_pairs_hook=OrderedDict)

qa/testdata/profile.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "alice",
3+
"vendor": true
4+
}

0 commit comments

Comments
 (0)