def test_should_succeed_for_ok_instances(self): for m in self._OK: money.check_valid(m)
def test_should_fail_when_the_units_and_nanos_are_mismatched(self): for m in self._MISMATCHED_UNITS: expect(lambda: money.check_valid(m)).to(raise_error(ValueError))
def test_should_fail_when_nanos_are_oob(self): expect(lambda: money.check_valid(self._NANOS_OOB)).to( raise_error(ValueError))
def test_should_fail_when_no_currency_is_set(self): expect(lambda: money.check_valid(messages.Money())).to( raise_error(ValueError))
def test_should_fail_when_the_currency_is_bad(self): expect(lambda: money.check_valid(self._BAD_CURRENCY)).to( raise_error(ValueError))
def test_should_fail_if_not_really_money(self): expect(lambda: money.check_valid(object())).to(raise_error(ValueError)) expect(lambda: money.check_valid(None)).to(raise_error(ValueError))
def test_should_fail_when_no_currency_is_set(self): expect(lambda: money.check_valid(sc_messages.Money())).to( raise_error(ValueError))