build.res: use ConstraintError iff a constraint invariant is violated.

In particular don't use it for type errors.
This commit is contained in:
whitequark 2019-06-04 10:23:27 +00:00
parent 51c03ca391
commit 4310254103
3 changed files with 8 additions and 7 deletions

View file

@ -192,12 +192,12 @@ class ConstraintManagerTestCase(FHDLTestCase):
self.cm.add_connectors([Connector("pmod", 0, "1 2")])
def test_wrong_lookup(self):
with self.assertRaises(NameError,
with self.assertRaises(ConstraintError,
msg="Resource user_led#1 does not exist"):
r = self.cm.lookup("user_led", 1)
def test_wrong_frequency_subsignals(self):
with self.assertRaises(ConstraintError,
with self.assertRaises(TypeError,
msg="Cannot constrain frequency of resource i2c#0 because "
"it has subsignals"):
self.cm.add_clock("i2c", 0, 10e6)