File: session.py

package info (click to toggle)
python-b2sdk 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,020 kB
  • sloc: python: 30,902; sh: 13; makefile: 8
file content (29 lines) | stat: -rw-r--r-- 905 bytes parent folder | download
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
######################################################################
#
# File: test/unit/fixtures/session.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from __future__ import annotations

import pytest
from apiver_deps import B2Session


@pytest.fixture
def b2_session(fake_account_info, fake_cache, fake_b2_raw_api):
    session = B2Session(account_info=fake_account_info, cache=fake_cache)
    session.raw_api = fake_b2_raw_api
    return session


@pytest.fixture
def fake_b2_session(mocker, fake_account_info, fake_cache, fake_b2_raw_api):
    b2_session = mocker.MagicMock(name='FakeB2Session', spec=B2Session)
    b2_session.account_info = fake_account_info
    b2_session.cache = fake_cache
    b2_session.raw_api = fake_b2_raw_api
    return b2_session