fix fee tests, whitespace

This commit is contained in:
Jack Robison 2017-04-12 17:42:55 -04:00
parent 4698910ab7
commit e6f92a2dc7
2 changed files with 26 additions and 27 deletions

View file

@ -846,7 +846,7 @@ class Daemon(AuthJSONRPCServer):
resolved = yield self.session.wallet.resolve_uri(uri)
if 'claim' in resolved:
claim = ClaimDict.deserialize(resolved['claim']['hex'].decode('hex'))
claim = ClaimDict.load_dict(resolved['claim']['value'])
final_fee = self._add_key_fee_to_est_data_cost(claim.source_fee, cost)
result = yield self._render_response(final_fee)
defer.returnValue(result)
@ -1546,7 +1546,6 @@ class Daemon(AuthJSONRPCServer):
'download_directory'(optional): (str) path to directory where file will be saved
Returns:
(dict) Dictionary contaning information about the stream
{
'completed': (bool) true if download is completed,
'file_name': (str) name of file,
@ -1554,7 +1553,7 @@ class Daemon(AuthJSONRPCServer):
'points_paid': (float) credit paid to download file,
'stopped': (bool) true if download is stopped,
'stream_hash': (str) stream hash of file,
'stream_name': (str) stream name ,
'stream_name': (str) stream name,
'suggested_file_name': (str) suggested file name,
'sd_hash': (str) sd hash of file,
'name': (str) name claim attached to file
@ -1568,7 +1567,6 @@ class Daemon(AuthJSONRPCServer):
'message': (str), None if full_status is false
'metadata': (dict) Metadata dictionary
}
"""
timeout = timeout if timeout is not None else self.download_timeout

View file

@ -86,7 +86,8 @@ def get_test_daemon(data_rate=None, generous=True, with_fee=False):
metadata.update(
{"fee": {"USD": {"address": "bQ6BGboPV2SpTMEP7wLNiAcnsZiH8ye6eA", "amount": 0.75}}})
daemon._resolve_name = lambda _: defer.succeed(metadata)
daemon.session.wallet.resolve_uri = lambda _: defer.succeed(smart_decode(json.dumps(metadata)))
migrated = smart_decode(json.dumps(metadata))
daemon.session.wallet.resolve_uri = lambda _: defer.succeed({'claim': {'value': migrated.claim_dict}})
return daemon