예제 #1
0
    def test_settings_arg_overrides_env_var(self):
        sys.argv = ['helga', '--settings', 'bar']

        with patch.multiple(helga, run=Mock(), settings=Mock()):
            with patch.dict('os.environ', {'HELGA_SETTINGS': 'foo'}):
                helga.main()
                helga.settings.configure.assert_called_with('bar')
                assert helga.run.called
예제 #2
0
    def test_settings_arg_overrides_env_var(self):
        sys.argv = ['helga', '--settings', 'bar']

        with patch.multiple(helga, run=Mock(), settings=Mock()):
            with patch.dict('os.environ', {'HELGA_SETTINGS': 'foo'}):
                helga.main()
                helga.settings.configure.assert_called_with('bar')
                assert helga.run.called
예제 #3
0
    def test_uses_settings_env_var(monkeypatch):
        sys.argv = ['helga']

        with patch.multiple(helga, run=Mock(), settings=Mock()):
            with patch.dict('os.environ', {'HELGA_SETTINGS': 'foo'}):
                helga.main()
                helga.settings.configure.assert_called_with('foo')
                assert helga.run.called
예제 #4
0
    def test_uses_settings_env_var(monkeypatch):
        sys.argv = ['helga']

        with patch.multiple(helga, run=Mock(), settings=Mock()):
            with patch.dict('os.environ', {'HELGA_SETTINGS': 'foo'}):
                helga.main()
                helga.settings.configure.assert_called_with('foo')
                assert helga.run.called