|
| 1 | +#!/usr/bin/env python3 |
| 2 | + |
| 3 | +# Copyright © 2020-2024, Meheret Tesfaye Batu <[email protected]> |
| 4 | +# 2024, Eyoel Tadesse <[email protected]> |
| 5 | +# Distributed under the MIT software license, see the accompanying |
| 6 | +# file COPYING or https://opensource.org/license/mit |
| 7 | + |
| 8 | +from os import path |
| 9 | + |
| 10 | +from hdwallet.cli.__main__ import cli_main |
| 11 | + |
| 12 | + |
| 13 | +def test_cryptocurrencies_list(cli_tester): |
| 14 | + cli = cli_tester.invoke( |
| 15 | + cli_main, [ |
| 16 | + "list", "c", |
| 17 | + ] |
| 18 | + ) |
| 19 | + |
| 20 | + assert cli.exit_code == 0 |
| 21 | + |
| 22 | + file_path = path.abspath( |
| 23 | + path.join(path.dirname(__file__), |
| 24 | + "../data/raw/cryptocurrencies.txt") |
| 25 | + ) |
| 26 | + |
| 27 | + with open(file_path, "r") as values: |
| 28 | + assert cli.output.strip() == values.read().strip() |
| 29 | + |
| 30 | +def test_languages_list(cli_tester): |
| 31 | + cli = cli_tester.invoke( |
| 32 | + cli_main, [ |
| 33 | + "list", "l", |
| 34 | + ] |
| 35 | + ) |
| 36 | + |
| 37 | + assert cli.exit_code == 0 |
| 38 | + |
| 39 | + file_path = path.abspath( |
| 40 | + path.join(path.dirname(__file__), |
| 41 | + "../data/raw/languages.txt") |
| 42 | + ) |
| 43 | + |
| 44 | + with open(file_path, "r") as values: |
| 45 | + assert cli.output.strip() == values.read().strip() |
| 46 | + |
| 47 | + |
| 48 | +def test_strengths_list(cli_tester): |
| 49 | + cli = cli_tester.invoke( |
| 50 | + cli_main, [ |
| 51 | + "list", "s", |
| 52 | + ] |
| 53 | + ) |
| 54 | + |
| 55 | + assert cli.exit_code == 0 |
| 56 | + |
| 57 | + file_path = path.abspath( |
| 58 | + path.join(path.dirname(__file__), |
| 59 | + "../data/raw/strengths.txt") |
| 60 | + ) |
| 61 | + |
| 62 | + with open(file_path, "r") as values: |
| 63 | + assert cli.output.strip() == values.read().strip() |
| 64 | + |
0 commit comments