File: test_dependency_list.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (21 lines) | stat: -rw-r--r-- 672 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
# fmt: off
from ase.dependencies import format_dependency


def test_format_dependency():
    name, path = format_dependency('ase')
    assert name.startswith('ase-')
    # The path is where the module was installed,
    # *or* maybe it has no path depending on how
    # it was installed.
    assert isinstance(path, str)


def test_format_dependency_builtin():
    # Must work on modules that did not come from files.
    # An example happens to be the built-in module math,
    # but this would typically occur depending on distro.
    #
    # See https://gitlab.com/ase/ase/-/issues/1005
    name, _path = format_dependency('math')
    assert name.startswith('math-')