use absolute imports instead of relative

This commit is contained in:
Lex Berezhny 2019-02-11 21:35:07 -05:00
parent 8aa50aa14f
commit 58da2f16c2
5 changed files with 23 additions and 13 deletions

View file

@ -1,4 +1,4 @@
from .testcase import CommandTestCase from integration.testcase import CommandTestCase
class AccountManagement(CommandTestCase): class AccountManagement(CommandTestCase):

View file

@ -1,5 +1,5 @@
import tempfile import tempfile
from .testcase import CommandTestCase from integration.testcase import CommandTestCase
class EpicAdventuresOfChris45(CommandTestCase): class EpicAdventuresOfChris45(CommandTestCase):
@ -41,7 +41,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
self.assertEqual(result, '8.989893') self.assertEqual(result, '8.989893')
# And is the channel resolvable and empty? # And is the channel resolvable and empty?
response = await self.out(self.daemon.jsonrpc_resolve(uri='lbry://@spam')) response = await self.out(self.daemon.jsonrpc_resolve('lbry://@spam'))
self.assertIn('lbry://@spam', response) self.assertIn('lbry://@spam', response)
self.assertIn('certificate', response['lbry://@spam']) self.assertIn('certificate', response['lbry://@spam'])
@ -71,7 +71,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
# Also checks that his new story can be found on the blockchain before # Also checks that his new story can be found on the blockchain before
# giving the link to all his friends. # giving the link to all his friends.
response = await self.out(self.daemon.jsonrpc_resolve(uri='lbry://@spam/hovercraft')) response = await self.out(self.daemon.jsonrpc_resolve('lbry://@spam/hovercraft'))
self.assertIn('lbry://@spam/hovercraft', response) self.assertIn('lbry://@spam/hovercraft', response)
self.assertIn('claim', response['lbry://@spam/hovercraft']) self.assertIn('claim', response['lbry://@spam/hovercraft'])
@ -103,7 +103,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
await self.confirm_tx(abandon['tx']['txid']) await self.confirm_tx(abandon['tx']['txid'])
# And now checks that the claim doesn't resolve anymore. # And now checks that the claim doesn't resolve anymore.
response = await self.out(self.daemon.jsonrpc_resolve(uri='lbry://@spam/hovercraft')) response = await self.out(self.daemon.jsonrpc_resolve('lbry://@spam/hovercraft'))
self.assertNotIn('claim', response['lbry://@spam/hovercraft']) self.assertNotIn('claim', response['lbry://@spam/hovercraft'])
# After abandoning he just waits for his LBCs to be returned to his account # After abandoning he just waits for his LBCs to be returned to his account
@ -159,7 +159,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
await self.confirm_tx(tx['txid']) await self.confirm_tx(tx['txid'])
# And check if his support showed up # And check if his support showed up
resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri=uri)) resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri))
# It obviously did! Because, blockchain baby \O/ # It obviously did! Because, blockchain baby \O/
self.assertEqual(resolve_result[uri]['claim']['amount'], '1.0') self.assertEqual(resolve_result[uri]['claim']['amount'], '1.0')
self.assertEqual(resolve_result[uri]['claim']['effective_amount'], '1.2') self.assertEqual(resolve_result[uri]['claim']['effective_amount'], '1.2')
@ -174,7 +174,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
await self.confirm_tx(tx['txid']) await self.confirm_tx(tx['txid'])
# And again checks if it went to the just right place # And again checks if it went to the just right place
resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri=uri)) resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri))
# Which it obviously did. Because....????? # Which it obviously did. Because....?????
self.assertEqual(resolve_result[uri]['claim']['supports'][1]['amount'], '0.3') self.assertEqual(resolve_result[uri]['claim']['supports'][1]['amount'], '0.3')
self.assertEqual(resolve_result[uri]['claim']['supports'][1]['txid'], tx['txid']) self.assertEqual(resolve_result[uri]['claim']['supports'][1]['txid'], tx['txid'])
@ -185,7 +185,7 @@ class EpicAdventuresOfChris45(CommandTestCase):
await self.confirm_tx(tx['txid']) await self.confirm_tx(tx['txid'])
# And check if his support showed up # And check if his support showed up
resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri=uri)) resolve_result = await self.out(self.daemon.jsonrpc_resolve(uri))
# It did! # It did!
self.assertEqual(resolve_result[uri]['claim']['supports'][2]['amount'], '0.4') self.assertEqual(resolve_result[uri]['claim']['supports'][2]['amount'], '0.4')
self.assertEqual(resolve_result[uri]['claim']['supports'][2]['txid'], tx['txid']) self.assertEqual(resolve_result[uri]['claim']['supports'][2]['txid'], tx['txid'])
@ -220,5 +220,5 @@ class EpicAdventuresOfChris45(CommandTestCase):
await self.confirm_tx(abandon['tx']['txid']) await self.confirm_tx(abandon['tx']['txid'])
# He them checks that the claim doesn't resolve anymore. # He them checks that the claim doesn't resolve anymore.
response = await self.out(self.daemon.jsonrpc_resolve(uri=uri)) response = await self.out(self.daemon.jsonrpc_resolve(uri))
self.assertNotIn('claim', response[uri]) self.assertNotIn('claim', response[uri])

View file

@ -4,7 +4,7 @@ from lbrynet.extras.wallet.transaction import Transaction
from lbrynet.error import InsufficientFundsError from lbrynet.error import InsufficientFundsError
from lbrynet.schema.claim import ClaimDict from lbrynet.schema.claim import ClaimDict
from .testcase import CommandTestCase from integration.testcase import CommandTestCase
class ClaimCommands(CommandTestCase): class ClaimCommands(CommandTestCase):

View file

@ -1,4 +1,4 @@
from .testcase import CommandTestCase from integration.testcase import CommandTestCase
class ResolveCommand(CommandTestCase): class ResolveCommand(CommandTestCase):
@ -46,3 +46,14 @@ class ResolveCommand(CommandTestCase):
self.assertEqual(claim['claim']['channel_name'], '@abc') self.assertEqual(claim['claim']['channel_name'], '@abc')
self.assertEqual(claim['certificate']['name'], '@abc') self.assertEqual(claim['certificate']['name'], '@abc')
self.assertEqual(claim['claims_in_channel'], 0) self.assertEqual(claim['claims_in_channel'], 0)
# resolving multiple at once
response = await self.resolve(['lbry://foo', 'lbry://foo2'])
self.assertSetEqual({'lbry://foo', 'lbry://foo2'}, set(response))
claim = response['lbry://foo2']
self.assertIn('certificate', claim)
self.assertIn('claim', claim)
self.assertEqual(claim['claim']['name'], 'foo2')
self.assertEqual(claim['claim']['channel_name'], '@abc')
self.assertEqual(claim['certificate']['name'], '@abc')
self.assertEqual(claim['claims_in_channel'], 0)

View file

@ -12,5 +12,4 @@ setenv =
TORBA_LEDGER=lbrynet.extras.wallet TORBA_LEDGER=lbrynet.extras.wallet
commands = commands =
orchstr8 download orchstr8 download
coverage run -p --source={envsitepackagesdir}/lbrynet -m unittest discover -vv integration.wallet coverage run -p --source={envsitepackagesdir}/lbrynet -m unittest discover -vv integration
coverage run -p --source={envsitepackagesdir}/lbrynet -m unittest discover -vv integration.cli