summaryrefslogtreecommitdiff
path: root/tests/testing.py
blob: e75d6309225b418ac6b3fece4161b646615903cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import os

from precisely import assert_that, equal_to


def generate_test_path(path):
    this_dir = os.path.dirname(__file__)
    return os.path.join(this_dir, "test-data", path)


def assert_equal(expected, actual):
    assert_that(actual, equal_to(expected))


def assert_raises(exception, func):
    try:
        func()
        assert False, "Expected " + exception.__name__
    except exception as error:
        return error