@@ -0,0 +1,1137 @@
+# -*- coding: utf-8 -*-%0Afrom mock import patch%0Aimport pytest%0A%0A%0A@pytest.fixture%0Adef cfg_strategy():%0A    from simple_settings.strategies import cfg%0A    return cfg.strategy%0A%0A%0Aclass TestCfgStrategy(object):%0A%0A    def test_should_check_a_valid_cfg_file(self, cfg_strategy):%0A        assert cfg_strategy.is_valid_file('foo.cfg') is True%0A%0A    def test_should_check_a_invalid_cfg_file(self, cfg_strategy):%0A        assert cfg_strategy.is_valid_file('foo.bar') is False%0A%0A    def test_should_load_dict_with_settings_of_cfg_file(self, cfg_strategy):%0A        settings = cfg_strategy.load_settings_file(%0A            'tests/samples/key_value.cfg'%0A        )%0A%0A        assert settings%5B'SIMPLE_STRING'%5D == 'simple'%0A%0A    def test_should_override_setting_by_environment(self, cfg_strategy):%0A        def _mock_env_side_effect(k, d=None):%0A            return u'simple from env' if k == 'SIMPLE_STRING' else d%0A%0A        with patch('os.environ.get', side_effect=_mock_env_side_effect):%0A            settings = cfg_strategy.load_settings_file(%0A                'tests/samples/key_value.cfg'%0A            )%0A%0A        assert settings%5B'SIMPLE_STRING'%5D == u'simple from env'%0A

create test for cfg strategy