Esempio n. 1
0
    def test_feature_segment_save_updates_string_feature_state_value_for_environment(
            self):
        # Given
        overridden_value = 'overridden value'
        feature_segment = FeatureSegment(feature=self.remote_config,
                                         segment=self.segment,
                                         environment=self.environment,
                                         value=overridden_value,
                                         value_type=STRING)

        # When
        feature_segment.save()

        # Then
        feature_state = FeatureState.objects.get(
            feature_segment=feature_segment, environment=self.environment)
        assert feature_state.get_feature_state_value() == overridden_value
Esempio n. 2
0
    def test_feature_segment_save_updates_boolean_feature_state_value_for_environment(
            self):
        # Given
        overridden_value = False
        feature_segment = FeatureSegment(feature=self.remote_config,
                                         segment=self.segment,
                                         environment=self.environment,
                                         value=str(overridden_value),
                                         value_type=BOOLEAN)

        # When
        feature_segment.save()

        # Then
        feature_state = FeatureState.objects.get(
            feature_segment=feature_segment, environment=self.environment)
        assert feature_state.get_feature_state_value() == overridden_value
Esempio n. 3
0
    def test_feature_segment_save_updates_integer_feature_state_value_for_environment(
        self, ):
        # Given
        overridden_value = 12
        feature_segment = FeatureSegment(
            feature=self.remote_config,
            segment=self.segment,
            environment=self.environment,
            value=str(overridden_value),
            value_type=INTEGER,
        )

        # When
        feature_segment.save()

        # Then
        feature_state = FeatureState.objects.get(
            feature_segment=feature_segment, environment=self.environment)
        assert feature_state.get_feature_state_value() == overridden_value