diff --git a/beem/account.py b/beem/account.py index ddab6dd25821b7e3e3a419e52c9c7f778f68d29e..e0e4b99e36182f2fd0d34d8fb51f7bd18f45906c 100644 --- a/beem/account.py +++ b/beem/account.py @@ -47,7 +47,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("gtg") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("gtg", steem_instance=stm) >>> print(account) <Account gtg> >>> print(account.balances) # doctest: +SKIP @@ -607,7 +609,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("steemit") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("steemit", steem_instance=stm) >>> account.get_feed(0, 1, raw_data=True) [] @@ -661,7 +665,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("steemit") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("steemit", steem_instance=stm) >>> account.get_feed_entries(0, 1) [] @@ -682,7 +688,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("steemit") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("steemit", steem_instance=stm) >>> entry = account.get_blog_entries(0, 1, raw_data=True)[0] >>> print("%s - %s - %s - %s" % (entry["author"], entry["permlink"], entry["blog"], entry["reblog_on"])) steemit - firstpost - steemit - 1970-01-01T00:00:00 @@ -704,7 +712,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("steemit") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("steemit", steem_instance=stm) >>> account.get_blog(0, 1) [<Comment @steemit/firstpost>] @@ -753,7 +763,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("steemit") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("steemit", steem_instance=stm) >>> account.get_blog_authors() [] @@ -1325,7 +1337,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("beem.app") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("beem.app", steem_instance=stm) >>> account.get_tags_used_by_author() [] @@ -1381,7 +1395,9 @@ class Account(BlockchainObject): .. code-block:: python >>> from beem.account import Account - >>> account = Account("beem.app") + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> account = Account("beem.app", steem_instance=stm) >>> account.get_account_votes() [] diff --git a/beem/comment.py b/beem/comment.py index 87aa6ccbfcd819de57ac279835ab7889ebb7e936..9b640919766405328c57a4bd2423afc6b938b336 100644 --- a/beem/comment.py +++ b/beem/comment.py @@ -33,13 +33,15 @@ class Comment(BlockchainObject): .. code-block:: python - >>> from beem.comment import Comment - >>> from beem.account import Account - >>> acc = Account("gtg") - >>> authorperm = acc.get_blog(limit=1)[0]["authorperm"] - >>> c = Comment(authorperm) - >>> postdate = c["created"] - >>> postdate_str = c.json()["created"] + >>> from beem.comment import Comment + >>> from beem.account import Account + >>> from beem import Steem + >>> stm = Steem("https://steemd.minnowsupportproject.org") + >>> acc = Account("gtg", steem_instance=stm) + >>> authorperm = acc.get_blog(limit=1)[0]["authorperm"] + >>> c = Comment(authorperm) + >>> postdate = c["created"] + >>> postdate_str = c.json()["created"] """ type_id = 8 diff --git a/tests/beem/test_cli.py b/tests/beem/test_cli.py index 890a67d0bc550280a939ffbbaa4080e3867ce606..b2e7e08a3081649b69127bb8af1585084e27ff00 100644 --- a/tests/beem/test_cli.py +++ b/tests/beem/test_cli.py @@ -152,20 +152,20 @@ class Testcases(unittest.TestCase): def test_upvote(self): runner = CliRunner() - result = runner.invoke(cli, ['-ds', 'upvote', '@test/abcd'], input="test\n") + result = runner.invoke(cli, ['-ds', 'upvote', '@steemit/firstpost'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'upvote', '@test/abcd', '100'], input="test\n") + result = runner.invoke(cli, ['-ds', 'upvote', '@steemit/firstpost', '100'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'upvote', '--weight', '100', '@test/abcd'], input="test\n") + result = runner.invoke(cli, ['-ds', 'upvote', '--weight', '100', '@steemit/firstpost'], input="test\n") self.assertEqual(result.exit_code, 0) def test_downvote(self): runner = CliRunner() - result = runner.invoke(cli, ['-ds', 'downvote', '@test/abcd'], input="test\n") + result = runner.invoke(cli, ['-ds', 'downvote', '@steemit/firstpost'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'downvote', '@test/abcd', '100'], input="test\n") + result = runner.invoke(cli, ['-ds', 'downvote', '@steemit/firstpost', '100'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'downvote', '--weight', '100', '@test/abcd'], input="test\n") + result = runner.invoke(cli, ['-ds', 'downvote', '--weight', '100', '@steemit/firstpost'], input="test\n") self.assertEqual(result.exit_code, 0) def test_transfer(self): @@ -319,21 +319,21 @@ class Testcases(unittest.TestCase): def test_resteem(self): runner = CliRunner() - result = runner.invoke(cli, ['-ds', 'resteem', '@test/abcde'], input="test\n") + result = runner.invoke(cli, ['-ds', 'resteem', '@steemit/firstposte'], input="test\n") self.assertEqual(result.exit_code, 0) def test_follow_unfollow(self): runner = CliRunner() - result = runner.invoke(cli, ['-ds', 'follow', 'beem1'], input="test\n") + result = runner.invoke(cli, ['-ds', 'follow', 'beempy'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'unfollow', 'beem1'], input="test\n") + result = runner.invoke(cli, ['-ds', 'unfollow', 'beempy'], input="test\n") self.assertEqual(result.exit_code, 0) def test_mute_unmute(self): runner = CliRunner() - result = runner.invoke(cli, ['-ds', 'mute', 'beem1'], input="test\n") + result = runner.invoke(cli, ['-ds', 'mute', 'beempy'], input="test\n") self.assertEqual(result.exit_code, 0) - result = runner.invoke(cli, ['-ds', 'unfollow', 'beem1'], input="test\n") + result = runner.invoke(cli, ['-ds', 'unfollow', 'beempy'], input="test\n") self.assertEqual(result.exit_code, 0) def test_witnesscreate(self):