2024-10-17 00:40:37 +00:00
|
|
|
import copy
|
2021-05-16 22:45:11 +00:00
|
|
|
import pickle
|
|
|
|
|
2017-02-15 10:10:55 +00:00
|
|
|
from boltons.typeutils import make_sentinel
|
|
|
|
|
2021-05-16 22:45:11 +00:00
|
|
|
NOT_SET = make_sentinel('not_set', var_name='NOT_SET')
|
2017-02-15 10:10:55 +00:00
|
|
|
|
|
|
|
def test_sentinel_falsiness():
|
2021-05-16 22:45:11 +00:00
|
|
|
assert not NOT_SET
|
|
|
|
|
|
|
|
|
|
|
|
def test_sentinel_pickle():
|
|
|
|
assert pickle.dumps(NOT_SET)
|
2024-10-17 00:40:37 +00:00
|
|
|
|
|
|
|
def test_sentinel_copy():
|
|
|
|
test = make_sentinel('test')
|
|
|
|
assert test is copy.copy(test)
|
|
|
|
assert test is copy.deepcopy(test)
|