Skip to content

Commit

Permalink
Improve code coveraged
Browse files Browse the repository at this point in the history
  • Loading branch information
prgeor committed Aug 4, 2022
1 parent 978900c commit 9793384
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/portstat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
Ethernet8 N/A 100,317 0 0
"""

intf_fec_counters_period = """\
The rates are calculated within 3 seconds period
IFACE STATE FEC_CORR FEC_UNCORR FEC_SYMBOL_ERR
--------- ------- ---------- ------------ ----------------
Ethernet0 D 0 0 0
Ethernet4 N/A 0 0 0
Ethernet8 N/A 0 0 0
"""

intf_counters_period = """\
The rates are calculated within 3 seconds period
IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR
Expand Down Expand Up @@ -281,6 +290,24 @@ def test_show_intf_fec_counters(self):
assert return_code == 0
assert result == intf_fec_counters

def test_show_intf_fec_counters_period(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"].commands["fec-stats"],
["-p {}".format(TEST_PERIOD)])
print(result.exit_code)
print(result.output)
assert result.exit_code == 0
assert result.output == intf_fec_counters_period

return_code, result = get_result_and_return_code(
'portstat -f -p {}'.format(TEST_PERIOD))
print("return_code: {}".format(return_code))
print("result = {}".format(result))
assert return_code == 0
assert result == intf_fec_counters_period



def test_show_intf_counters_period(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["interfaces"].commands["counters"], [
Expand Down

0 comments on commit 9793384

Please sign in to comment.