File: test_settings.py

package info (click to toggle)
python-zeep 4.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,600 kB
  • sloc: python: 15,551; makefile: 13
file content (29 lines) | stat: -rw-r--r-- 842 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from zeep.settings import Settings


def test_settings_set_context_raw_response():
    settings = Settings()

    assert settings.raw_response is False
    with settings(raw_response=True):
        assert settings.raw_response is True

        with settings():
            # Check that raw_response is not changed by default value
            assert settings.raw_response is True
    # Check that the original value returned
    assert settings.raw_response is False


def test_settings_set_context_with_exception():
    settings = Settings()

    assert settings.raw_response is False
    try:
        with settings(raw_response=True):
            assert settings.raw_response is True
            raise RuntimeError
    except RuntimeError:
        pass
    # Check that the original value returned
    assert settings.raw_response is False