1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

tests: add partial pylint support

This commit is contained in:
Pavol Rusnak 2017-06-07 19:06:26 +02:00
parent 59421d4b3a
commit 845a3a7e0d
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
101 changed files with 255 additions and 19 deletions

View File

@ -47,6 +47,9 @@ test: ## run unit tests
testpy: ## run selected unit tests from python-trezor
cd tests ; ./run_tests_python_trezor.sh
pylint: ## run pylint on application sources
pylint --rcfile=pylint.rc -E $(shell find src -name *.py)
## build commands:
build: build_boardloader build_bootloader build_firmware build_unix build_cross ## build all

View File

@ -1,5 +1,5 @@
def const(c):
pass
return c
def mem_info(verbose=None):
pass

View File

@ -1,11 +1,14 @@
def hexlify(data, sep=None):
pass
return 0
def unhexlify(data):
pass
return 0
def a2b_base64(data):
pass
return 0
def b2a_base64(data):
pass
return 0
def crc32(data, crc=None):
return 0

37
mocks/uctypes.py Normal file
View File

@ -0,0 +1,37 @@
ARRAY = 0
NATIVE = 0
LITTLE_ENDIAN = 0
BIG_ENDIAN = 0
VOID = 0
UINT8 = 0
INT8 = 0
UINT16 = 0
INT16 = 0
UINT32 = 0
INT32 = 0
UINT64 = 0
INT64 = 0
BFUINT8 = 0
BFINT8 = 0
BFUINT16 = 0
BFINT16 = 0
BFUINT32 = 0
BFINT32 = 0
BF_POS = 0
BF_LEN = 0
FLOAT32 = 0
def struct(addr, descriptor, layout_type=NATIVE):
return 0
def sizeof(struct):
return 0
def addressof(obj):
return 0
def bytes_at(addr, size):
return 0
def bytearray_at(addr, size):
return 0

View File

@ -1,14 +1,14 @@
def calcsize(fmt):
pass
return 0
def pack(fmt, *args):
pass
return 0
def pack_info(fmt, buffer, offset, *args):
pass
return 0
def unpack(fmt, data):
pass
return 0
def unpack_from(fmt, data, offset=0):
pass
return 0

View File

@ -1,11 +1,11 @@
def localtime(secs=None):
pass
return 0
def ticks_ms():
pass
return 0
def mktime():
pass
return 0
def sleep(seconds):
pass
@ -17,16 +17,19 @@ def sleep_us(us):
pass
def ticks_ms():
pass
return 0
def ticks_us():
pass
return 0
def ticks_cpu():
pass
return 0
def ticks_add(ticks_in, delta_in):
return 0
def ticks_diff(old, new):
pass
return 0
def time():
pass
return 0

2
pylint.rc Normal file
View File

@ -0,0 +1,2 @@
[MASTER]
init-hook='sys.path.insert(0, "mocks")'

View File

@ -1,3 +1,5 @@
from micropython import const
import uctypes
import ustruct
import utime

View File

@ -1,3 +1,5 @@
from micropython import const
import trezor.main
from trezor import msg
from trezor import ui

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Address(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ApplySettings(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ButtonAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ButtonRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
Other = const(1)
FeeOverThreshold = const(2)
ConfirmOutput = const(3)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Cancel(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ChangePin(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class CipherKeyValue(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class CipheredKeyValue(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ClearSession(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class CoinType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkDecision(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkFlashErase(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkGetState(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkLog(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkMemory(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkMemoryRead(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkMemoryWrite(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodeType import HDNodeType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DebugLinkStop(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DecryptMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class DecryptedMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ECDHSessionKey(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EncryptMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EncryptedMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Entropy(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EntropyAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EntropyRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EstimateTxSize(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EthereumAddress(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EthereumGetAddress(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EthereumSignTx(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EthereumTxAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class EthereumTxRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Failure(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
UnexpectedMessage = const(1)
ButtonExpected = const(2)
SyntaxError = const(3)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .CoinType import CoinType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class FirmwareErase(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class FirmwareRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class FirmwareUpload(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .MultisigRedeemScriptType import MultisigRedeemScriptType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .IdentityType import IdentityType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class GetEntropy(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class GetFeatures(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class GetPublicKey(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodeType import HDNodeType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class HDNodeType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class IdentityType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Initialize(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
SPENDADDRESS = const(0)
SPENDMULTISIG = const(1)
EXTERNAL = const(2)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodeType import HDNodeType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class MessageSignature(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
Initialize = const(0)
Ping = const(1)
Success = const(2)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodePathType import HDNodePathType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
PAYTOADDRESS = const(0)
PAYTOSCRIPTHASH = const(1)
PAYTOMULTISIG = const(2)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class PassphraseAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class PassphraseRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class PinMatrixAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class PinMatrixRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
Current = const(1)
NewFirst = const(2)
NewSecond = const(3)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Ping(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodeType import HDNodeType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class RecoveryDevice(p.MessageType):

View File

@ -1,3 +1,5 @@
# Automatically generated by pb2py
from micropython import const
ScrambledWords = const(0)
Matrix = const(1)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
TXINPUT = const(0)
TXOUTPUT = const(1)
TXMETA = const(2)

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class ResetDevice(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class SetU2FCounter(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .IdentityType import IdentityType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class SignMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class SignTx(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class SignedIdentity(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .TxInputType import TxInputType
from .TxOutputType import TxOutputType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .HDNodeType import HDNodeType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class Success(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .TxInputType import TxInputType
from .TxOutputBinType import TxOutputBinType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .TransactionType import TransactionType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .MultisigRedeemScriptType import MultisigRedeemScriptType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class TxOutputBinType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .MultisigRedeemScriptType import MultisigRedeemScriptType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
from .TxRequestDetailsType import TxRequestDetailsType
from .TxRequestSerializedType import TxRequestSerializedType

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class TxRequestDetailsType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class TxRequestSerializedType(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class TxSize(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class VerifyMessage(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class WipeDevice(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class WordAck(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
import protobuf as p
class WordRequest(p.MessageType):

View File

@ -1,4 +1,6 @@
# Automatically generated by pb2py
from micropython import const
Plain = const(0)
Matrix9 = const(1)
Matrix6 = const(2)

View File

@ -1,3 +1,6 @@
# Automatically generated by pb2py
from micropython import const
WordRequest = const(46)
DebugLinkMemoryWrite = const(112)
ButtonAck = const(27)

View File

@ -1,3 +1,5 @@
from micropython import const
import sys
import math
import utime

View File

@ -2,7 +2,7 @@ from micropython import const
from trezor import ui, res
from trezor.crypto import random
from trezor.ui import display
from treozr.ui.button import Button, BTN_CLICKED, CLEAR_BUTTON, CLEAR_BUTTON_ACTIVE
from trezor.ui.button import Button, BTN_CLICKED, CLEAR_BUTTON, CLEAR_BUTTON_ACTIVE
def digit_area(i):

Some files were not shown because too many files have changed in this diff Show More