def test_is_persisted(self): i = librato.Instrument(self.conn, 'test inst') assert i.is_persisted() == False i = librato.Instrument(self.conn, 'test inst', id=1234) assert i.is_persisted() == True
def test_instrument_save_creates_new_record(self): instrument_name = 'my instrument name' i = librato.Instrument(self.conn, instrument_name) assert i.id is None i.save() assert i.name == instrument_name