File: test_lazy_imports.py

package info (click to toggle)
python-globus-sdk 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,144 kB
  • sloc: python: 35,242; sh: 37; makefile: 35
file content (23 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import pytest

import globus_sdk


def test_explicit_dir_func_works():
    assert "TransferClient" in dir(globus_sdk)
    assert "__all__" in dir(globus_sdk)


def test_force_eager_imports_can_run():
    # this check will not do much, other than ensuring that this does not crash
    globus_sdk._force_eager_imports()


def test_attribute_error_on_bad_name():
    with pytest.raises(AttributeError) as excinfo:
        globus_sdk.DEIMOS_DOWN_REMOVE_ALL_PLANTS

    err = excinfo.value
    assert (
        str(err) == "module globus_sdk has no attribute DEIMOS_DOWN_REMOVE_ALL_PLANTS"
    )