def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry({}) self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.endpoint = BMAEndpoint(PyBMAEndpoint("", "127.0.0.1", "", 50000)) self.node = Node("test_currency", [self.endpoint], "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", nice_blockchain.bma_blockchain_current, Node.ONLINE, time.time(), {}, "ucoin", "0.14.0", 0) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access) self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "Wallet 1", self.identities_registry) self.wallet.init_cache(self.application, self.community) # Salt/password : "******" # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "john", [self.community], [self.wallet], [], self.identities_registry)
def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry() self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.mock_nice_blockchain = nice_blockchain.get_mock(self.lp) self.node = Node(self.mock_nice_blockchain.peer(), "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", None, Node.ONLINE, time.time(), {}, "ucoin", "0.14.0", 0) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access) self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "Wallet 1", self.identities_registry) # Salt/password : "******" # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "john", [self.community], [self.wallet], [], self.identities_registry) self.password_asker = PasswordAskerDialog(self.account) self.password_asker.password = "******" self.password_asker.remember = True
def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry({}) self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50005) self.node = Node("test_currency", [self.endpoint], "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", nice_blockchain.bma_blockchain_current, Node.ONLINE, time.time(), {}, "duniter", "0.14.0", 0) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access) self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "Wallet 1", self.identities_registry) self.wallet.init_cache(self.application, self.community) # Salt/password : "******" # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "john", [self.community], [self.wallet], [], self.identities_registry)
def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry() self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.peer = Peer.from_signed_raw("""Version: 2 Type: Peer Currency: meta_brouzouf PublicKey: 8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU Block: 48698-000005E0F228038E4DDD4F6CA4ACB01EC88FBAF8 Endpoints: BASIC_MERKLED_API duniter.inso.ovh 80 82o1sNCh1bLpUXU6nacbK48HBcA9Eu2sPkL1/3c2GtDPxBUZd2U2sb7DxwJ54n6ce9G0Oy7nd1hCxN3fS0oADw== """) self.node = Node(self.peer, "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", None, Node.ONLINE, time.time(), {}, "duniter", "0.12.0", 0, Mock("aiohttp.ClientSession")) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access)
def test_load_save_community(self): network = Network("test_currency", [], Mock("aiohttp.ClientSession")) bma_access = BmaAccess([], network) community = Community("test_currency", network, bma_access) json_data = community.jsonify() community_from_json = Community.load(json_data, parse_version('0.12.0')) self.assertEqual(community.name, community_from_json.name) self.assertEqual(len(community.network._nodes), len(community_from_json.network._nodes)) community_from_json.network.session.close()
def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry() self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50000) self.node = Node("test_currency", [self.endpoint], "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", None, Node.ONLINE, time.time(), {}, "ucoin", "0.12.0", 0) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access)
def setUp(self): self.setUpQuamash() QLocale.setDefault(QLocale("en_GB")) self.identities_registry = IdentitiesRegistry({}) self.application = Application(self.qapplication, self.lp, self.identities_registry) self.application.preferences['notifications'] = False self.mock_new_community = init_new_community.get_mock(self.lp) self.endpoint = BMAEndpoint("", "127.0.0.1", "", 50010) self.node = Node(self.mock_new_community.peer(), "", "HnFcSms8jzwngtVomTTnzudZx7SHUQY8sVE1y8yBmULk", None, Node.ONLINE, time.time(), {}, "duniter", "0.14.0", 0, session=aiohttp.ClientSession()) self.network = Network.create(self.node) self.bma_access = BmaAccess.create(self.network) self.community = Community("test_currency", self.network, self.bma_access) self.wallet = Wallet(0, "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "Wallet 1", self.identities_registry) # Salt/password : "******" # Pubkey : 7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ self.account = Account("testsakia", "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ", "john", [self.community], [self.wallet], [], self.identities_registry) self.account.notifications['warning_certifying_first_time'] = False self.password_asker = PasswordAskerDialog(self.account) self.password_asker.password = "******" self.password_asker.remember = True