33 lines
1.3 KiB
Python
33 lines
1.3 KiB
Python
import unittest
|
|
|
|
import npc_proportions
|
|
|
|
|
|
class NpcProportionTests(unittest.TestCase):
|
|
def test_every_library_character_is_measured(self):
|
|
rows = npc_proportions.report()
|
|
self.assertEqual(len(rows), 12)
|
|
self.assertEqual(len({row["character"] for row in rows}), 12)
|
|
for row in rows:
|
|
self.assertGreater(row["measurements"]["height"], 1.6)
|
|
self.assertIn(row["rig"], ("core", "quaternius"))
|
|
# Both rigs must resolve every measurement; a missing joint would
|
|
# collapse a ratio to zero.
|
|
for key, value in row["measurements"].items():
|
|
self.assertGreater(value, 0.0, f"{row['character']} {key}")
|
|
|
|
def test_current_library_stays_inside_the_stylized_guide(self):
|
|
for row in npc_proportions.report():
|
|
# ADR-0018: the Quaternius base is accepted at its upstream
|
|
# (semi-realistic) proportions, so the stylized band does not apply.
|
|
# The measurement stays in the report for the face/silhouette gate.
|
|
if row["rig"] != "core":
|
|
continue
|
|
for key, check in row["checks"].items():
|
|
self.assertEqual(check["status"], "ok",
|
|
f"{row['character']} {key}={check['value']}")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|