Ejemplo n.º 1
0
    def test_does_not_set_same_value_for_same_key(self):

        config = factories.SystemInfo()

        set_system_info(config.key, config.value)

        new_config = (model.Session.query(SystemInfo).filter_by(
            key=config.key).first())

        assert config.id == new_config.id
Ejemplo n.º 2
0
    def test_does_not_set_same_value_for_same_key(self):

        config = factories.SystemInfo()

        set_system_info(config.key, config.value)

        new_config = model.Session.query(SystemInfo) \
                                  .filter_by(key=config.key).first()

        assert_equals(config.id, new_config.id)
        assert_equals(config.revision_id, new_config.revision_id)
Ejemplo n.º 3
0
    def test_does_not_set_same_value_for_same_key(self):

        config = factories.SystemInfo()

        set_system_info(config.key, config.value)

        new_config = model.Session.query(SystemInfo) \
                                  .filter_by(key=config.key).first()

        assert_equals(config.id, new_config.id)
        assert_equals(config.revision_id, new_config.revision_id)
Ejemplo n.º 4
0
    def test_set_value(self):

        key = factories.SystemInfo.stub().key
        value = "test_value"
        set_system_info(key, value)

        results = model.Session.query(SystemInfo).filter_by(key=key).all()

        assert len(results) == 1

        obj = results[0]

        assert obj.key == key
        assert obj.value == value
Ejemplo n.º 5
0
    def test_set_value(self):

        key = 'config_option_1'
        value = 'test_value'

        set_system_info(key, value)

        results = model.Session.query(SystemInfo).filter_by(key=key).all()

        assert_equals(len(results), 1)

        obj = results[0]

        assert_equals(obj.key, key)
        assert_equals(obj.value, value)
Ejemplo n.º 6
0
    def test_set_value(self):

        key = 'config_option_1'
        value = 'test_value'

        set_system_info(key, value)

        results = model.Session.query(SystemInfo).filter_by(key=key).all()

        assert_equals(len(results), 1)

        obj = results[0]

        assert_equals(obj.key, key)
        assert_equals(obj.value, value)