Skip to content

Commit

Permalink
Fix mocking issue
Browse files Browse the repository at this point in the history
  • Loading branch information
emesik committed Sep 14, 2021
1 parent 49c7175 commit 16b2c42
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 117 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"address_pool_gap": 20,
"assets": {
"available": [
{
"asset_name": "",
"policy_id": "6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7",
"quantity": 1
}
],
"total": [
{
"asset_name": "",
"policy_id": "6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7",
"quantity": 1
}
]
},
"balance": {
"available": {
"quantity": 5115910,
"unit": "lovelace"
},
"reward": {
"quantity": 0,
"unit": "lovelace"
},
"total": {
"quantity": 5115910,
"unit": "lovelace"
}
},
"delegation": {
"active": {
"status": "not_delegating"
},
"next": []
},
"id": "04aebef49c24086f603db7a6d157f915c5c9411a",
"name": "wallet A",
"passphrase": {
"last_updated_at": "2021-08-07T09:40:30.476568834Z"
},
"state": {
"status": "ready"
},
"tip": {
"absolute_slot_number": 33971219,
"epoch_number": 148,
"height": {
"quantity": 2814240,
"unit": "block"
},
"slot_number": 404819,
"time": "2021-08-07T12:47:15Z"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"address_pool_gap": 20,
"assets": {
"available": [
{
"asset_name": "",
"policy_id": "6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7",
"quantity": 1
}
],
"total": [
{
"asset_name": "",
"policy_id": "6b8d07d69639e9413dd637a1a815a7323c69c86abbafb66dbfdb1aa7",
"quantity": 1
}
]
},
"balance": {
"available": {
"quantity": 2000000,
"unit": "lovelace"
},
"reward": {
"quantity": 0,
"unit": "lovelace"
},
"total": {
"quantity": 2000000,
"unit": "lovelace"
}
},
"delegation": {
"active": {
"status": "not_delegating"
},
"next": []
},
"id": "5e27c10c9cb253c93a771732fd7dcbb56d34bc47",
"name": "wallet B",
"passphrase": {
"last_updated_at": "2021-08-07T09:40:30.991029966Z"
},
"state": {
"status": "ready"
},
"tip": {
"absolute_slot_number": 33971661,
"epoch_number": 148,
"height": {
"quantity": 2814257,
"unit": "block"
},
"slot_number": 405261,
"time": "2021-08-07T12:54:37Z"
}
}

This file was deleted.

This file was deleted.

25 changes: 22 additions & 3 deletions tests/test_rest_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,18 +788,37 @@ def test_utxo_stats(self):

class TestDoublewallet(JSONTestCase):
service = None
wida = "04aebef49c24086f603db7a6d157f915c5c9411a"
widb = "5e27c10c9cb253c93a771732fd7dcbb56d34bc47"
passphrasea = "pass.12345678"
passphraseb = "pass.87654321"
data_subdir = "test_rest_backend"

@responses.activate
def setUp(self):
super(TestDoublewallet, self).setUp()
self.service = WalletService(WalletREST())
responses.add(
responses.GET,
self._url("wallets/{:s}".format(self.wida)),
json=self._read(
"test_transfer_asset-30-GET_wallets_{:s}.json".format(self.wida)
),
status=200,
)
responses.add(
responses.GET,
self._url("wallets/{:s}".format(self.widb)),
json=self._read(
"test_transfer_asset-60-GET_wallets_{:s}.json".format(self.widb)
),
status=200,
)
super(TestDoublewallet, self).setUp()
self.wala = self.service.wallet(
"04aebef49c24086f603db7a6d157f915c5c9411a", passphrase=self.passphrasea
self.wida, passphrase=self.passphrasea
)
self.walb = self.service.wallet(
"5e27c10c9cb253c93a771732fd7dcbb56d34bc47", passphrase=self.passphraseb
self.widb, passphrase=self.passphraseb
)

def _url(self, path):
Expand Down

0 comments on commit 16b2c42

Please sign in to comment.