Combine normal and okay statuses.

- Changed all normal results to ok.
- Normal results were intended for tools that produced info and
  weren't expected to have problem results.
  - Ultimately not worth distinguishing from tools that sometimes
    show problems.
- One less color status makes the summary table simpler.
- Also changed the not-applicable status color to the lighter grey
  that normal used to have.
- Made the success status non-configurable since ok status is the
  only sensible status at the moment.
This commit is contained in:
Andrew Hamilton 2021-07-20 00:48:18 +10:00
parent e6380bb1d7
commit 4197cebd1b
5 changed files with 53 additions and 85 deletions

View file

@ -26,10 +26,9 @@
│ x - Open the current file with xdg-open. │
│ │
│Statuses: │
  Normal │
  Ok │
  Problem │
  Not applicable │
  Not applicable │
  Running │
  Timed out │
. Pending │
@ -56,5 +55,6 @@
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
 help quit tab:focus orient log edit next sort refresh fullscreen xdg-open 

View file

@ -76,10 +76,10 @@ class ToolsTestCase(unittest.TestCase):
with unittest.mock.patch.object(tools.pwd, "getpwuid",
return_value=mock_pw_entry):
self._test_tool(tools.metadata,
[("hi3.py", tools.Status.normal)])
[("hi3.py", tools.Status.ok)])
def test_contents(self):
self._test_tool(tools.contents, [("hi3.py", tools.Status.normal)])
self._test_tool(tools.contents, [("hi3.py", tools.Status.ok)])
HI_OK = [("hi3.py", tools.Status.ok)]
@ -94,12 +94,12 @@ class ToolsTestCase(unittest.TestCase):
# ("hi3_test.py", tools.Status.ok),
# ("test_foo.py", tools.Status.ok)])
HI_NORMAL = [("hi3.py", tools.Status.normal)]
HI_OK = [("hi3.py", tools.Status.ok)]
def test_pydoc(self):
# FIX: This is failing inside AppImages.
if "APPDIR" not in os.environ:
self._test_tool(tools.pydoc, self.HI_NORMAL)
self._test_tool(tools.pydoc, self.HI_OK)
def test_mypy(self):
self._test_tool(tools.mypy, self.HI_OK)
@ -114,10 +114,10 @@ class ToolsTestCase(unittest.TestCase):
self._test_tool(tools.pylint, self.HI_OK)
def test_python_gut(self):
self._test_tool(tools.python_gut, self.HI_NORMAL)
self._test_tool(tools.python_gut, self.HI_OK)
def test_python_modulefinder(self):
self._test_tool(tools.python_modulefinder, self.HI_NORMAL)
self._test_tool(tools.python_modulefinder, self.HI_OK)
def test_python_mccabe(self):
self._test_tool(tools.python_mccabe, self.HI_OK)
@ -125,7 +125,7 @@ class ToolsTestCase(unittest.TestCase):
# FIX: Make the golden-file deterministic
# def test_pydisasm(self):
# self._test_tool(tools.pydisasm,
# [("hi3.cpython-34.pyc", tools.Status.normal)])
# [("hi3.cpython-34.pyc", tools.Status.ok)])
def test_perl_syntax(self):
self._test_tool(tools.perl_syntax,
@ -134,7 +134,7 @@ class ToolsTestCase(unittest.TestCase):
])
# def test_perltidy(self):
# self._test_tool(tools.perltidy, [("perl.pl", tools.Status.normal)])
# self._test_tool(tools.perltidy, [("perl.pl", tools.Status.ok)])
# def test_perl6_syntax(self):
# self._test_tool(tools.perl6_syntax,
@ -145,37 +145,37 @@ class ToolsTestCase(unittest.TestCase):
def test_objdump_headers(self):
self._test_tool(tools.objdump_headers,
[("Mcrt1.o", tools.Status.normal)])
[("Mcrt1.o", tools.Status.ok)])
def test_objdump_disassemble(self):
self._test_tool(tools.objdump_disassemble,
[("Mcrt1.o", tools.Status.problem)])
def test_readelf(self):
self._test_tool(tools.readelf, [("Mcrt1.o", tools.Status.normal)])
self._test_tool(tools.readelf, [("Mcrt1.o", tools.Status.ok)])
def test_zipinfo(self):
self._test_tool(tools.zipinfo, [("hi.zip", tools.Status.normal)])
self._test_tool(tools.zipinfo, [("hi.zip", tools.Status.ok)])
def test_tar_gz(self):
self._test_tool(tools.tar_gz, [("hi.tar.gz", tools.Status.normal),
("hi.tgz", tools.Status.normal)])
self._test_tool(tools.tar_gz, [("hi.tar.gz", tools.Status.ok),
("hi.tgz", tools.Status.ok)])
def test_tar_bz2(self):
self._test_tool(tools.tar_bz2, [("hi.tar.bz2", tools.Status.normal)])
self._test_tool(tools.tar_bz2, [("hi.tar.bz2", tools.Status.ok)])
def test_nm(self):
self._test_tool(tools.nm, [("libieee.a", tools.Status.normal),
("libpcprofile.so", tools.Status.normal)])
self._test_tool(tools.nm, [("libieee.a", tools.Status.ok),
("libpcprofile.so", tools.Status.ok)])
def test_pdf2txt(self):
self._test_tool(tools.pdf2txt, [("standard.pdf", tools.Status.normal)])
self._test_tool(tools.pdf2txt, [("standard.pdf", tools.Status.ok)])
def test_html_syntax(self):
self._test_tool(tools.html_syntax, [("hi.html", tools.Status.problem)])
def test_html2text(self):
self._test_tool(tools.html2text, [("hi.html", tools.Status.normal)])
self._test_tool(tools.html2text, [("hi.html", tools.Status.ok)])
def test_cpp_syntax_gcc(self):
self._test_tool(tools.cpp_syntax_gcc, [("hello.cpp", tools.Status.ok)])
@ -186,7 +186,7 @@ class ToolsTestCase(unittest.TestCase):
def test_pil(self):
for extension in ["png", "jpg", "gif", "bmp", "ppm", "tiff", "tga"]:
self._test_tool(tools.pil, [("circle." + extension,
tools.Status.normal)])
tools.Status.ok)])
class LruCacheWithEvictionTestCase(unittest.TestCase):

View file

@ -32,7 +32,7 @@ class WorkerTestCase(unittest.TestCase):
worker_.process.stdin.write(f"{compression}\n".encode("utf-8"))
future = worker_.run_tool("foo", tools.metadata)
status = loop.run_until_complete(future)
self.assertEqual(status, tools.Status.normal)
self.assertEqual(status, tools.Status.ok)
result_path = os.path.join(tools.CACHE_PATH, "foo-metadata")
self.assertTrue(os.path.exists(result_path))