Skip to content

Commit

Permalink
Renamed motorola CLI command to srec
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Zoppi <[email protected]>
  • Loading branch information
TexZK committed Feb 22, 2024
1 parent 8d8ee6f commit ffbb806
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/hexrec/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,14 +700,14 @@ def validate(
# ----------------------------------------------------------------------------

@main.group()
def motorola() -> None:
def srec() -> None:
"""Motorola SREC specific"""


# ----------------------------------------------------------------------------

# noinspection PyShadowingBuiltins
@motorola.command()
@srec.command()
@click.option('-f', '--format', 'format', type=DATA_FMT_CHOICE,
default='ascii', help='Header data format.')
@click.argument('infile', type=FILE_PATH_IN)
Expand All @@ -733,7 +733,7 @@ def get_header(
# ----------------------------------------------------------------------------

# noinspection PyShadowingBuiltins
@motorola.command()
@srec.command()
@click.option('-f', '--format', 'format', type=DATA_FMT_CHOICE,
default='ascii', help='Header data format.')
@click.argument('header', type=str)
Expand Down Expand Up @@ -779,7 +779,7 @@ def set_header(
# ----------------------------------------------------------------------------

# noinspection PyShadowingBuiltins
@motorola.command()
@srec.command()
@click.argument('infile', type=FILE_PATH_IN)
@click.argument('outfile', type=FILE_PATH_OUT)
def del_header(
Expand Down
20 changes: 10 additions & 10 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,43 +190,43 @@ def test_validate(datapath):
assert result.output == ''


def test_motorola_dummy(datapath):
def test_srec_dummy(datapath):
runner = CliRunner()
result = runner.invoke(main, f'motorola -h'.split())
result = runner.invoke(main, f'srec -h'.split())
assert result.exit_code == 2


def test_motorola_get_header_headless(datapath):
def test_srec_get_header_headless(datapath):
runner = CliRunner()
path_in = str(datapath / 'headless.mot')
result = runner.invoke(main, f'motorola get-header {path_in}'.split())
result = runner.invoke(main, f'srec get-header {path_in}'.split())

assert result.exit_code == 0
assert result.output == ''


def test_motorola_get_header_empty(datapath):
def test_srec_get_header_empty(datapath):
runner = CliRunner()
path_in = str(datapath / 'bytes.mot')
result = runner.invoke(main, f'motorola get-header {path_in}'.split())
result = runner.invoke(main, f'srec get-header {path_in}'.split())

assert result.exit_code == 0
assert result.output == '\n'


def test_motorola_get_header_ascii(datapath):
def test_srec_get_header_ascii(datapath):
runner = CliRunner()
path_in = str(datapath / 'header.mot')
result = runner.invoke(main, f'motorola get-header -f ascii {path_in}'.split())
result = runner.invoke(main, f'srec get-header -f ascii {path_in}'.split())

assert result.exit_code == 0
assert result.output == 'ABC\n'


def test_motorola_get_header_hex(datapath):
def test_srec_get_header_hex(datapath):
runner = CliRunner()
path_in = str(datapath / 'header.mot')
result = runner.invoke(main, f'motorola get-header -f hex {path_in}'.split())
result = runner.invoke(main, f'srec get-header -f hex {path_in}'.split())

assert result.exit_code == 0
assert result.output == '414243\n'
Expand Down

0 comments on commit ffbb806

Please sign in to comment.