diff --git a/lib/base_controller.py b/lib/base_controller.py index 6ade2a04..db7a05d2 100644 --- a/lib/base_controller.py +++ b/lib/base_controller.py @@ -663,7 +663,10 @@ def execute_help(self, line, method=None) -> str: async def _do_default(self, line): # Override method to provide default command behavior self.view.print_result(self.execute_help(line)) - raise ShellException("%s: command not found." % (" ".join(line))) + + if line: + # It is only an error if there is still something left to be parsed + raise ShellException("%s: command not found." % (" ".join(line))) def pre_command(self, line): """ diff --git a/lib/live_cluster/manage_controller.py b/lib/live_cluster/manage_controller.py index 6e25280c..f9ac17ca 100644 --- a/lib/live_cluster/manage_controller.py +++ b/lib/live_cluster/manage_controller.py @@ -511,7 +511,7 @@ async def _supports_quotas(self, nodes): @CommandHelp( "Create a role", - usage="role priv [ns [set ]] [allow [ [...]]] [read ] [write ]", + usage=" priv [ns [set ]] [allow [ [...]]] [read ] [write ]", modifiers=( ModifierHelp("role", "Name of the new role."), ModifierHelp( diff --git a/lib/view/sheet/render/base_rsheet.py b/lib/view/sheet/render/base_rsheet.py index 2fa516a9..43afd8bd 100644 --- a/lib/view/sheet/render/base_rsheet.py +++ b/lib/view/sheet/render/base_rsheet.py @@ -14,6 +14,7 @@ from collections import OrderedDict from itertools import groupby +import math from operator import itemgetter from lib.utils import util @@ -337,8 +338,8 @@ def _infer_projector(self, dfield, key): pass try: - float(entry) - has_float = True + if float(entry) != math.inf: + has_float = True continue except (ValueError, TypeError): pass diff --git a/test/unit/test_base_controller.py b/test/unit/test_base_controller.py index 9abda82a..6eb2e270 100644 --- a/test/unit/test_base_controller.py +++ b/test/unit/test_base_controller.py @@ -161,9 +161,8 @@ def test_find_method(self): except ShellException: self.assertEqual("ShellException", expected_method) - async def test_execute(self): - test_lines = [ - ([], "ShellException"), + @parameterized.expand( + [ (["fake"], "ShellException"), (["fakea1"], "fake1"), (["fakeb2"], "fake2"), @@ -171,17 +170,17 @@ async def test_execute(self): (["fakeb2", "f"], "ShellException"), (["fakeb2", "foo"], "foo"), ] - + ) + async def test_execute(self, line, expected_result): r = FakeRoot() - for line, expected_result in test_lines: - try: - actual_result = await r(line) - actual_result = actual_result[0] - except ShellException: - self.assertEqual(expected_result, "ShellException") - else: - self.assertEqual(expected_result, actual_result) + try: + actual_result = await r(line) + actual_result = actual_result[0] + except ShellException: + self.assertEqual(expected_result, "ShellException") + else: + self.assertEqual(expected_result, actual_result) @parameterized.expand( [