From 6472ca55e16fab898476ce2f08ef71d57efaf3c3 Mon Sep 17 00:00:00 2001 From: darshanime Date: Sat, 18 Nov 2017 19:01:26 +0530 Subject: [PATCH] fix env version attribute --- httpie/config.py | 2 +- tests/test_config.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/httpie/config.py b/httpie/config.py index 9cb6c4af..7621878f 100644 --- a/httpie/config.py +++ b/httpie/config.py @@ -104,7 +104,7 @@ class Config(BaseConfigDict): try: implicit_content_type = self.pop('implicit_content_type') except KeyError: - pass + self.save() else: if implicit_content_type == 'form': self['default_options'].insert(0, '--form') diff --git a/tests/test_config.py b/tests/test_config.py index c3091173..9b0a2097 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,4 +1,6 @@ +from httpie import __version__ from utils import TestEnvironment, http +from httpie.context import Environment def test_default_options(httpbin): @@ -31,3 +33,8 @@ def test_migrate_implicit_content_type(): config.load() assert 'implicit_content_type' not in config assert config['default_options'] == ['--form'] + + +def test_current_version(): + version = Environment().config['__meta__']['httpie'] + assert version == __version__