def test_persistence(self):
        queue = self.queues_manager.get_queue("testqueue")
        queue.connect()
        queue.push(Message(b"data a", uuid=b"a", ttl=1, flags=FLAG_PERSISTENT))
        queue.push(Message(b"data b", uuid=b"b"))
        queue.push(Message(b"data c", uuid=b"c", ttl=1, flags=FLAG_PERSISTENT))
        self.assertEqual(len(queue), 3)
        stored_items = self.queues_manager.storage.get_items("testqueue")
        self.assertEqual(len(stored_items), 2)
        self.assertEqual(stored_items[0].uuid, b"a")
        self.assertEqual(stored_items[1].uuid, b"c")

        # remove "a"
        queue.pop()
        stored_items = self.queues_manager.storage.get_items("testqueue")
        self.assertEqual(len(stored_items), 1)
        self.assertEqual(stored_items[0].uuid, b"c")

        # remove "b", "c" remains
        queue.pop()
        stored_items = self.queues_manager.storage.get_items("testqueue")
        self.assertEqual(len(stored_items), 1)

    ##################################################################
Save an object to a database node.
dataset/ETHPy150Open dsiroky/snakemq/tests/unittests/tests_queues.py/TestQueue.test_persistence--crossover with--dataset/ETHPy150Open nigelsmall/py2neo/py2neo/ext/ogm/store.py/Store.save