LALPulsar 7.1.2.1-bf6a62b
test_public_sft_directory.py
Go to the documentation of this file.
1# Copyright (C) 2022 Karl Wette
2#
3# This program is free software; you can redistribute it and/or modify it
4# under the terms of the GNU General Public License as published by the
5# Free Software Foundation; either version 2 of the License, or (at your
6# option) any later version.
7#
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11# Public License for more details.
12#
13# You should have received a copy of the GNU General Public License along
14# with this program; if not, write to the Free Software Foundation, Inc.,
15# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
17import sys
18import pytest
19
20from lalpulsar.public_sft_directory import public_sft_directory
21
22
23SFT_FILENAME_TO_DIRECTORY = (
24 (
25 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1257800000-1800.sft",
26 "H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND-1257",
27 ),
28 (
29 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1257901800-1800.sft",
30 "H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND-1257",
31 ),
32 (
33 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258003600-1800.sft",
34 "H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND-1258",
35 ),
36 (
37 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258105400-1800.sft",
38 "H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND-1258",
39 ),
40 (
41 "H-1_H1_1800SFT_O4RUN+R1+Choft+WTKEY5-1258207200-1800.sft",
42 "H1_1800SFT_O4RUN+R1+Choft+WTKEY5_BROADBAND-1258",
43 ),
44 (
45 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0010Hz0W0008Hz0-1257800000-9000.sft",
46 "H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND-NBF0010Hz0W0008Hz0",
47 ),
48 (
49 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0018Hz0W0008Hz0-1257900000-9000.sft",
50 "H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND-NBF0018Hz0W0008Hz0",
51 ),
52 (
53 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0026Hz0W0008Hz0-1258000000-9000.sft",
54 "H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND-NBF0026Hz0W0008Hz0",
55 ),
56 (
57 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0034Hz0W0008Hz0-1258100000-9000.sft",
58 "H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND-NBF0034Hz0W0008Hz0",
59 ),
60 (
61 "H-5_H1_1800SFT_O5SIM+R2+Choft+WHANN_NBF0042Hz0W0008Hz0-1258200000-9000.sft",
62 "H1_1800SFT_O5SIM+R2+Choft+WHANN_NARROWBAND-NBF0042Hz0W0008Hz0",
63 ),
64)
65
66
67@pytest.mark.parametrize("filename,directory", SFT_FILENAME_TO_DIRECTORY)
68def test_public_sft_directory(filename, directory):
69 assert public_sft_directory(filename) == directory
70
71
72if __name__ == "__main__":
73 args = sys.argv[1:] or ["-v", "-rs", "--junit-xml=junit-public_sft_directory.xml"]
74 sys.exit(pytest.main(args=[__file__] + args))
def test_public_sft_directory(filename, directory)