for nutrient_id, amt in analysis.items():
if nutrient_id not in nut_amts:
nut_amts[int(nutrient_id)] = amt
- else:
- nut_amts[int(nutrient_id)] += amt
+ else: # pragma: no cover
+ # nut_amts[int(nutrient_id)] += amt
+ raise ValueError("Not implemented yet, need to sum up nutrient amounts")
print_bars()
return nut_amts
from ntclient.persistence.sql.nt import sql as sql_nt
from ntclient.utils import CLI_CONFIG
+# TODO: handle mocks in tests so coverage doesn't vary when bugs exist (vs. don't)
+
def insert(args: list, exception: Exception) -> None:
"""Insert bug report into nt.sqlite3, return True/False."""
)
except sqlite3.IntegrityError as exc:
print(f"WARN: {repr(exc)}")
- if repr(exc) == (
- "IntegrityError('UNIQUE constraint failed: " "bug.arguments, bug.stack')"
- ):
+ dupe_bug_insertion_exc = (
+ "IntegrityError('UNIQUE constraint failed: bug.arguments, bug.stack')"
+ )
+ if repr(exc) == dupe_bug_insertion_exc:
print("INFO: bug report already exists")
else:
raise