Debian Codegraph @

test/helpers.py

raw
1 ######################################################################
2 #
3 # File: test/helpers.py
4 #
5 # Copyright 2023 Backblaze Inc. All Rights Reserved.
6 #
7 # License https://www.backblaze.com/using_b2_code.html
8 #
9 ######################################################################
10 import platform
11
12 import pytest
13
14 _MISSING = object()
15
16
17 def skip_on_windows(*args, reason='Not supported on Windows', **kwargs):
18 return pytest.mark.skipif(
19 platform.system() == 'Windows',
20 reason=reason,
21 )(*args, **kwargs)
22
23
24 def b2_uri_args_v3(bucket_name, path=_MISSING):
25 if path is _MISSING:
26 return [bucket_name]
27 else:
28 return [bucket_name, path]
29
30
31 def b2_uri_args_v4(bucket_name, path=_MISSING):
32 if path is _MISSING:
33 path = ''
34 return [f'b2://{bucket_name}/{path}']