def assert_option_fails(self, key):
        # key is a normal_key, converted to
        # __compaction_key__

        key = "__compaction_{}__".format(key)

        with patch.object(self.model, key, 10), self.assertRaises(CQLEngineException):
            get_compaction_options(self.model)
Пример #2
0
    def assert_option_fails(self, key):
        # key is a normal_key, converted to
        # __compaction_key__

        key = "__compaction_{}__".format(key)

        with patch.object(self.model, key, 10), \
                self.assertRaises(CQLEngineException):
            get_compaction_options(self.model)
Пример #3
0
    def test_empty_compaction(self):
        class EmptyCompactionModel(Model):
            __compaction__ = None
            cid = columns.UUID(primary_key=True)
            name = columns.Text()

        result = get_compaction_options(EmptyCompactionModel)
        self.assertEqual({}, result)
Пример #4
0
    def test_empty_compaction(self):
        class EmptyCompactionModel(Model):
            __compaction__ = None
            cid = columns.UUID(primary_key=True)
            name = columns.Text()

        result = get_compaction_options(EmptyCompactionModel)
        self.assertEqual({}, result)
Пример #5
0
    def test_sstable_size_in_mb(self):
        with patch.object(self.model, '__compaction_sstable_size_in_mb__', 32):
            result = get_compaction_options(self.model)

        assert result['sstable_size_in_mb'] == 32
Пример #6
0
 def test_simple_leveled(self):
     result = get_compaction_options(self.model)
     assert result['class'] == LeveledCompactionStrategy
Пример #7
0
 def test_min_threshold(self):
     self.model.__compaction_min_threshold__ = 2
     result = get_compaction_options(self.model)
     assert result['min_threshold'] == 2
Пример #8
0
 def test_size_tiered(self):
     result = get_compaction_options(self.model)
     assert result['class'] == SizeTieredCompactionStrategy
Пример #9
0
    def test_sstable_size_in_mb(self):
        with patch.object(self.model, '__compaction_sstable_size_in_mb__', 32):
            result = get_compaction_options(self.model)

        assert result['sstable_size_in_mb'] == 32
Пример #10
0
 def test_simple_leveled(self):
     result = get_compaction_options(self.model)
     assert result['class'] == LeveledCompactionStrategy
Пример #11
0
 def test_min_threshold(self):
     self.model.__compaction_min_threshold__ = 2
     result = get_compaction_options(self.model)
     assert result['min_threshold'] == 2
Пример #12
0
 def test_size_tiered(self):
     result = get_compaction_options(self.model)
     assert result['class'] == SizeTieredCompactionStrategy
    def test_sstable_size_in_mb(self):
        with patch.object(self.model, "__compaction_sstable_size_in_mb__", 32):
            result = get_compaction_options(self.model)

        assert result["sstable_size_in_mb"] == "32"