def test_dumper_marker_crud(self):
        saved = DumperMarkerModelTest._create_save_dumper_marker()
        retrieved = DumperMarker.get_by_id(saved.id)
        self.assertEqual(saved.marker, retrieved.marker,
                         'Same marker was not returned.')
        # test update
        time_now = date_utils.get_datetime_utc_now()
        retrieved.updated_at = time_now
        saved = DumperMarker.add_or_update(retrieved)
        retrieved = DumperMarker.get_by_id(saved.id)
        self.assertEqual(retrieved.updated_at, time_now, 'Update to marker failed.')
        # cleanup
        DumperMarkerModelTest._delete([retrieved])
        try:
            retrieved = DumperMarker.get_by_id(saved.id)
        except __HOLE__:
            retrieved = None
        self.assertIsNone(retrieved, 'managed to retrieve after failure.')
dataset/ETHPy150Open StackStorm/st2/st2common/tests/unit/test_db_marker.py/DumperMarkerModelTest.test_dumper_marker_crud