Project

General

Profile

0001-esirius-ignore-DES-timestamp-within-tests-53697.patch

Nicolas Roche, 04 May 2021 10:08 AM

Download (1.31 KB)

View differences:

Subject: [PATCH] esirius: ignore DES timestamp within tests (#53697)

 tests/test_esirius.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/test_esirius.py
108 108

  
109 109
@pytest.mark.parametrize('secret_key', ['xxx', ''])
110 110
def test_pre_request(connector, secret_key):
111 111
    @httmock.urlmatch(netloc='esirius.example.net', path='/an/uri/', method='GET')
112 112
    def esirius_mock(url, request):
113 113
        assert request.headers['Accept'] == 'application/json; charset=utf-8'
114 114
        assert bool(request.headers.get('token_info_caller')) == bool(secret_key)
115 115
        if secret_key:
116
            assert request.headers['token_info_caller'][:42] == b'f3G6sjRZETBam6vcdrAxmvJQTX5hh6OjZ8XlUO6SMo'
116
            assert request.headers['token_info_caller'][:32] == b'f3G6sjRZETBam6vcdrAxmvJQTX5hh6Oj'
117 117
        return httmock.response(200)
118 118

  
119 119
    connector.secret_key = secret_key
120 120
    connector.save()
121 121
    with httmock.HTTMock(esirius_mock):
122 122
        connector.request('an/uri/', method='get', params="somes")
123 123

  
124 124

  
125
-