summaryrefslogtreecommitdiff
path: root/tests/pathutils.py
blob: 1f10b0b958ddc88bac804a60106c4cff1af190c6 (plain)
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
import os.path


BASEDIR = os.path.abspath(os.path.dirname(__file__))


def full_path(local_file):
    return os.path.join(BASEDIR, local_file)


def dotname(module):
    if not BASEDIR.endswith("tests"):
        return f"tests.{module}"
    else:
        return module


try:
    from saml2.sigver import get_xmlsec_binary
except ImportError:
    get_xmlsec_binary = None

if get_xmlsec_binary:
    xmlsec_path = get_xmlsec_binary(["/opt/local/bin"])
else:
    xmlsec_path = "/usr/bin/xmlsec1"