Revision e1d133e434f05b050d2db8d69281231d86ffabfe authored by Marge Bot on 13 September 2022, 15:23:52 UTC, committed by Marge Bot on 13 September 2022, 15:23:52 UTC
Co-authored-by: Rémy El Sibaïe <remy.el-sibaie@nomadic-labs.com>

Approved-by: Andrea Cerone <andrea.cerone@trili.tech>
Approved-by: François Thiré <francois.thire@nomadic-labs.com>
Approved-by: Raphaël Proust <code@bnwr.net>

See merge request https://gitlab.com/tezos/tezos/-/merge_requests/6284
2 parent s 413d6e5 + 0c6f7f8
Raw File
paths.py
from os import path
import os
from typing import List


def all_contracts(
    contract_path: str, directories: List[str] = None
) -> List[str]:
    if directories is None:
        directories = [
            'attic',
            'opcodes',
            'macros',
            'mini_scenarios',
            'non_regression',
        ]
    contracts = []
    for directory in directories:
        for contract in os.listdir(path.join(contract_path, directory)):
            contracts.append(path.join(directory, contract))
    return contracts


def tezos_home() -> str:
    # we rely on a fixed directory structure of the tezos repo
    # TEZOS_HOME/tests_python/tools/paths.py
    cur_path = os.path.dirname(os.path.realpath(__file__))
    tezos_home = os.path.dirname(os.path.dirname(cur_path)) + '/'
    assert os.path.isfile(f'{tezos_home}/tests_python/tools/paths.py')
    return tezos_home


# Use environment variable if tests_python are put outside the tezos
# TEZOS_HOME = os.environ.get('TEZOS_HOME')
TEZOS_HOME = tezos_home()
TEZOS_BINARIES = os.environ.get('TEZOS_BINARIES')

ACCOUNT_PATH = path.join(TEZOS_HOME, 'tests_python', 'account')
back to top