Exemplo n.º 1
0
    def test_builder_build(self):
        # generate shards for testing
        bucket = Builder(addresses["beta"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path)

        # see if the shards exist
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            print("PATH", path)
            self.assertTrue(os.path.exists(path))

        bucket.clean(self.store_path)

        # generate shards for testing
        bucket = Builder(addresses["gamma"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path, cleanup=True)

        # see if the shards are deleted
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertFalse(os.path.exists(path))
Exemplo n.º 2
0
    def test_builder_build(self):
        # generate shards for testing
        bucket = Builder(addresses["beta"],
                         my_shard_size,
                         my_max_size,
                         debug=True)
        bucket.build(self.store_path)

        # see if the shards exist
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            print("PATH", path)
            self.assertTrue(os.path.exists(path))

        bucket.clean(self.store_path)

        # generate shards for testing
        bucket = Builder(addresses["gamma"],
                         my_shard_size,
                         my_max_size,
                         debug=True)
        bucket.build(self.store_path, cleanup=True)

        # see if the shards are deleted
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            self.assertFalse(os.path.exists(path))
Exemplo n.º 3
0
    def test_builder_build(self):
        # generate shards for testing
        bucket = Builder(addresses["beta"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path)

        # see if the shards exist
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            print("PATH", path)
            self.assertTrue(os.path.exists(path))

        bucket.clean(self.store_path)

        # generate shards for testing
        bucket = Builder(addresses["gamma"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path, cleanup=True)

        # see if the shards are deleted
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertFalse(os.path.exists(path))
Exemplo n.º 4
0
 def test_use_folder_tree_clean(self):
     bucket = Builder(addresses["beta"], my_shard_size, my_max_size,
                      use_folder_tree=True)
     bucket.build(self.store_path)
     self.assertTrue(bucket.checkup(self.store_path))
     bucket.clean(self.store_path)
     def callback(a, d, files):
         self.assertTrue(len(files) == 0)
     os.walk(self.store_path, callback, None)
Exemplo n.º 5
0
    def test_use_folder_tree_clean(self):
        bucket = Builder(addresses["beta"], my_shard_size, my_max_size,
                         my_min_free_size,
                         use_folder_tree=True)
        bucket.build(self.store_path)
        self.assertTrue(bucket.checkup(self.store_path))
        bucket.clean(self.store_path)

        def callback(a, d, files):
            self.assertTrue(len(files) == 0)
        os.walk(self.store_path, callback, None)
Exemplo n.º 6
0
    def test_builder_clean(self):
        # generate shards for testing
        bucket = Builder(addresses["delta"], my_shard_size, my_max_size)
        bucket.build(self.store_path)

        # see if the shards exist
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            self.assertTrue(os.path.exists(path))

        # clean command
        bucket.clean(self.store_path)

        # see if the shards are deleted
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            self.assertFalse(os.path.exists(path))
Exemplo n.º 7
0
    def test_builder_clean(self):
        # generate shards for testing
        bucket = Builder(addresses["delta"], my_shard_size, my_max_size, debug=True)
        bucket.build(self.store_path)

        # see if the shards exist
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            self.assertTrue(os.path.exists(path))

        # clean command
        bucket.clean(self.store_path)

        # see if the shards are deleted
        for shard_num in range(height):
            path = os.path.join(self.store_path, bucket.build_seed(shard_num))
            self.assertFalse(os.path.exists(path))
Exemplo n.º 8
0
    def test_builder_clean(self):
        # generate shards for testing
        bucket = Builder(addresses["delta"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path)

        # see if the shards exist
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertTrue(os.path.exists(path))

        # clean command
        bucket.clean(self.store_path)

        # see if the shards are deleted
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertFalse(os.path.exists(path))
Exemplo n.º 9
0
    def test_builder_clean(self):
        # generate shards for testing
        bucket = Builder(addresses["delta"], my_shard_size, my_max_size,
                         my_min_free_size)
        bucket.build(self.store_path)

        # see if the shards exist
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertTrue(os.path.exists(path))

        # clean command
        bucket.clean(self.store_path)

        # see if the shards are deleted
        seeds = bucket.build_seeds(height)
        for seed in seeds:
            path = os.path.join(self.store_path, seed)
            self.assertFalse(os.path.exists(path))