JsonObj = Dict[str, Any]
 
+_status_map: Dict[TestStatus, str] = {
+       TestStatus.SUCCESS: "PASS",
+       TestStatus.SKIPPED: "SKIP",
+       TestStatus.TEST_CRASHED: "ERROR",
+}
+
 def _get_group_json(test: Test, def_config: str, build_dir: str) -> JsonObj:
        sub_groups = []  # List[JsonObj]
        test_cases = []  # List[JsonObj]
 
        for subtest in test.subtests:
-               if len(subtest.subtests):
+               if subtest.subtests:
                        sub_group = _get_group_json(subtest, def_config,
                                build_dir)
                        sub_groups.append(sub_group)
-               else:
-                       test_case = {"name": subtest.name, "status": "FAIL"}
-                       if subtest.status == TestStatus.SUCCESS:
-                               test_case["status"] = "PASS"
-                       elif subtest.status == TestStatus.SKIPPED:
-                               test_case["status"] = "SKIP"
-                       elif subtest.status == TestStatus.TEST_CRASHED:
-                               test_case["status"] = "ERROR"
-                       test_cases.append(test_case)
+                       continue
+               status = _status_map.get(subtest.status, "FAIL")
+               test_cases.append({"name": subtest.name, "status": status})
 
        test_group = {
                "name": test.name,