Esempio n. 1
0
    def test_create_fs_state_backend(self):

        self.assertIsNotNone(FsStateBackend("file://var/checkpoints/"))

        self.assertIsNotNone(FsStateBackend("file://var/checkpoints/", "file://var/savepoints/"))

        self.assertIsNotNone(FsStateBackend("file://var/checkpoints/",
                                            "file://var/savepoints/", 2048))

        self.assertIsNotNone(FsStateBackend(
            "file://var/checkpoints/", "file://var/savepoints/", 2048, 2048, True))

        self.assertIsNotNone(FsStateBackend(
            "file://var/checkpoints/", "file://var/savepoints/", 2048, 4096))
Esempio n. 2
0
    def test_create_rocks_db_state_backend(self):

        self.assertIsNotNone(RocksDBStateBackend("file://var/checkpoints/"))

        self.assertIsNotNone(RocksDBStateBackend("file://var/checkpoints/", True))

        self.assertIsNotNone(RocksDBStateBackend("file://var/checkpoints/", False))

        self.assertIsNotNone(RocksDBStateBackend(
            checkpoint_stream_backend=FsStateBackend("file://var/checkpoints/")))
Esempio n. 3
0
    def test_get_min_file_size_threshold(self):

        state_backend = FsStateBackend("file://var/checkpoints/")

        self.assertEqual(state_backend.get_min_file_size_threshold(), 1024)

        state_backend = FsStateBackend("file://var/checkpoints/", file_state_size_threshold=2048)

        self.assertEqual(state_backend.get_min_file_size_threshold(), 2048)
Esempio n. 4
0
    def test_get_checkpoint_path(self):

        state_backend = FsStateBackend("file://var/checkpoints/")

        self.assertEqual(state_backend.get_checkpoint_path(),
                         "file://var/checkpoints")