21、加密货币钱包测试与IPFS系统介绍

加密货币钱包测试与IPFS系统介绍

1. 加密货币钱包测试

为了确保加密货币钱包GUI应用的质量,我们将为其编写测试。这里不会进行详尽的测试,而是为每个标签页创建一个测试,不涉及应用非UI部分的测试。

1.1 账户标签页测试

创建名为 test_account.py 的测试文件,并将其保存到 tests 目录下。以下是测试脚本:

import sys, os
sys.path.append(os.path.realpath(os.path.dirname(__file__)+"/.."))
from wallet import WalletWidget
from PySide2.QtWidgets import QInputDialog
from PySide2 import QtCore

def test_account(qtbot, monkeypatch):
    wallet = WalletWidget()
    qtbot.addWidget(wallet)
    old_accounts_amount = wallet.account_widget.accounts_layout.count()
    monkeypatch.setattr(QInputDialog, 'getText', lambda *args: ("password", True))
    qtbot.mouseClick(wallet.account_widget.create_account_button, QtCore.Qt.Lef
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值