File: test_utils.py

package info (click to toggle)
python-prodigy 2.3.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,488 kB
  • sloc: python: 820; makefile: 10
file content (21 lines) | stat: -rw-r--r-- 381 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
import math
import tempfile
from pathlib import Path

from prodigy_prot.modules.utils import check_path, dg_to_kd


def test_check_path():

    temp_f = tempfile.NamedTemporaryFile(delete=False)

    result = check_path(temp_f.name)

    assert result == temp_f.name

    Path(temp_f.name).unlink()


def test_dg_to_kd():

    assert math.isclose(dg_to_kd(0.0), 1.0, rel_tol=1e-9)