def test_good_macs(self, session, host, mac): interface = Interface(host=host) assert object_state(interface).transient interface.mac = mac session.add(interface) session.flush()
def test_bad_macs(self, session, host, mac): interface = Interface(host=host) assert object_state(interface).transient with pytest.raises(InvalidMACAddressException): interface.mac = mac with pytest.raises(IntegrityError): session.add(interface) session.flush()