Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALFrame 3.0.7.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
test_utils_frtools.py
Go to the documentation of this file.
1# -*- coding: utf-8 -*-
2#
3# Copyright (C) 2019 Duncan Macleod
4#
5# This program is free software; you can redistribute it and/or modify it
6# under the terms of the GNU General Public License as published by the
7# Free Software Foundation; either version 2 of the License, or (at your
8# option) any later version.
9#
10# This program is distributed in the hope that it will be useful, but
11# WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
13# Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18
19"""Tests for lalframe.utils.frtools
20"""
21
22import sys
23import os
24try:
25 from pathlib import Path
26except ImportError as exc: # probably macports
27 import warnings
28 warnings.warn(str(exc))
29 sys.exit(77)
30
31import pytest
32
33from lalframe import utils
34
35# find test GWF file
36TEST_PATH = Path(os.getenv(
37 "LAL_TEST_SRCDIR",
38 Path(__file__).parent,
39)).absolute().parent
40TEST_GWF = TEST_PATH / "F-TEST-600000060-60.gwf"
41
42# test result
43TEST_CHANNELS = [
44 "H1:LSC-AS_Q",
45]
46
47
49 assert utils.get_channels(TEST_GWF) == TEST_CHANNELS
50
51
52if __name__ == '__main__':
53 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-utils.xml"]
54 sys.exit(pytest.main(args=[__file__] + args))