File: test_missing_type.py

package info (click to toggle)
python-globus-sdk 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,172 kB
  • sloc: python: 35,227; sh: 44; makefile: 35
file content (28 lines) | stat: -rw-r--r-- 631 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
import copy
import pickle

import pytest

from globus_sdk._missing import MISSING, MissingType


def test_missing_type_cannot_be_instantiated():
    with pytest.raises(TypeError, match="MissingType should not be instantiated"):
        MissingType()


def test_missing_sentinel_bools_as_false():
    assert bool(MISSING) is False


def test_str_of_missing():
    assert str(MISSING) == "<globus_sdk.MISSING>"


def test_copy_of_missing_is_self():
    assert copy.copy(MISSING) is MISSING
    assert copy.deepcopy(MISSING) is MISSING


def test_pickle_of_missing_is_self():
    assert pickle.loads(pickle.dumps(MISSING)) is MISSING