Skip to content
Snippets Groups Projects
Commit e8b3bdcd authored by Holger Nahrstaedt's avatar Holger Nahrstaedt
Browse files

Fix steemconnect unit test; prepare release 0.19.34

parent eddab42a
No related branches found
No related tags found
No related merge requests found
...@@ -138,6 +138,13 @@ before transmitting the packed file. Please check the hash-sum after downloading ...@@ -138,6 +138,13 @@ before transmitting the packed file. Please check the hash-sum after downloading
Changelog Changelog
========= =========
0.19.34
-------
* Several bug fixes (including issue #17)
* missing steem_instance fixed
* update_account_profile fixed
* update_account_metadata added
0.19.33 0.19.33
------- -------
* Several bug fixes (including issue #13 and #16) * Several bug fixes (including issue #13 and #16)
......
...@@ -10,7 +10,6 @@ import unittest ...@@ -10,7 +10,6 @@ import unittest
from parameterized import parameterized from parameterized import parameterized
import random import random
import json import json
from six import PY2
from pprint import pprint from pprint import pprint
from beem import Steem, exceptions from beem import Steem, exceptions
from beem.amount import Amount from beem.amount import Amount
...@@ -65,10 +64,16 @@ class Testcases(unittest.TestCase): ...@@ -65,10 +64,16 @@ class Testcases(unittest.TestCase):
"test1", 1.000, "STEEM", memo="test") "test1", 1.000, "STEEM", memo="test")
sc2 = SteemConnect(steem_instance=bts) sc2 = SteemConnect(steem_instance=bts)
url = sc2.url_from_tx(tx) url = sc2.url_from_tx(tx)
if PY2: url_test = 'https://v2.steemconnect.com/sign/transfer?from=test&to=test1&amount=1.000+STEEM&memo=test'
self.assertEqual(url, 'https://v2.steemconnect.com/sign/transfer?from=test&memo=test&to=test1&amount=1.000+STEEM') self.assertEqual(len(url), len(url_test))
else: self.assertEqual(len(url.split('?')), 2)
self.assertEqual(url, 'https://v2.steemconnect.com/sign/transfer?from=test&to=test1&amount=1.000+STEEM&memo=test') self.assertEqual(url.split('?')[0], url_test.split('?')[0])
url_parts = (url.split('?')[1]).split('&')
url_test_parts = (url_test.split('?')[1]).split('&')
self.assertEqual(len(url_parts), 4)
self.assertEqual(len(list(set(url_parts).intersection(set(url_test_parts)))), 4)
@parameterized.expand([ @parameterized.expand([
("non_appbase"), ("non_appbase"),
...@@ -81,7 +86,13 @@ class Testcases(unittest.TestCase): ...@@ -81,7 +86,13 @@ class Testcases(unittest.TestCase):
bts = self.appbase bts = self.appbase
sc2 = SteemConnect(steem_instance=bts) sc2 = SteemConnect(steem_instance=bts)
url = sc2.get_login_url("localhost", scope="login,vote") url = sc2.get_login_url("localhost", scope="login,vote")
if PY2: url_test = 'https://v2.steemconnect.com/oauth2/authorize?client_id=None&redirect_uri=localhost&scope=login,vote'
self.assertEqual(url, 'https://v2.steemconnect.com/oauth2/authorize?client_id=None&scope=login,vote&redirect_uri=localhost') self.assertEqual(len(url), len(url_test))
else: self.assertEqual(len(url.split('?')), 2)
self.assertEqual(url, 'https://v2.steemconnect.com/oauth2/authorize?client_id=None&redirect_uri=localhost&scope=login,vote') self.assertEqual(url.split('?')[0], url_test.split('?')[0])
url_parts = (url.split('?')[1]).split('&')
url_test_parts = (url_test.split('?')[1]).split('&')
self.assertEqual(len(url_parts), 3)
self.assertEqual(len(list(set(url_parts).intersection(set(url_test_parts)))), 3)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment