File: testutils.py

package info (click to toggle)
pgxnclient 1.3.2-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 672 kB
  • sloc: python: 3,545; sh: 71; makefile: 53
file content (20 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
pgxnclient -- unit test utilities
"""

# Copyright (C) 2011-2021 Daniele Varrazzo

# This file is part of the PGXN client

import os


def ifunlink(fn):
    """Delete a file if exists."""
    if os.path.exists(fn):
        os.unlink(fn)


def get_test_filename(*parts):
    """Return the complete file name for a testing file."""
    return os.path.join(os.path.dirname(__file__), 'testdata', *parts)