|
| 1 | +#!/usr/bin/python3 |
| 2 | + |
| 3 | +# Copyright 2019 Francisco Pina Martins <[email protected]> |
| 4 | +# This file is part of structure_threader. |
| 5 | +# structure_threader is free software: you can redistribute it and/or modify |
| 6 | +# it under the terms of the GNU General Public License as published by |
| 7 | +# the Free Software Foundation, either version 3 of the License, or |
| 8 | +# (at your option) any later version. |
| 9 | + |
| 10 | +# structure_threader is distributed in the hope that it will be useful, |
| 11 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +# GNU General Public License for more details. |
| 14 | + |
| 15 | +# You should have received a copy of the GNU General Public License |
| 16 | +# along with structure_threader. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + |
| 18 | +import pytest |
| 19 | +import mockups |
| 20 | +import structure_threader.wrappers.alstructure_wrapper as alsw |
| 21 | + |
| 22 | + |
| 23 | +def test_alstr_cli_generator(): |
| 24 | + """ |
| 25 | + Tests if alstr_cli_generator() is working correctlly. |
| 26 | + """ |
| 27 | + # Define arguments |
| 28 | + arg = mockups.Arguments() |
| 29 | + arg.infile += ".bed" |
| 30 | + k_val = 4 |
| 31 | + |
| 32 | + # "Rscript", arg.external_prog, infile, str(k_val), output_file |
| 33 | + |
| 34 | + mock_cli = ["Rscript", "EP", "IF", str(k_val), "alstr_K4"] |
| 35 | + |
| 36 | + returned_cli, out_file = alsw.alstr_cli_generator(arg, k_val) |
| 37 | + assert returned_cli == mock_cli |
| 38 | + assert out_file == "alstr_K4" |
0 commit comments