|
| 1 | +######################################################################### |
| 2 | +# MacSyLib - Python library to detect macromolecular systems # |
| 3 | +# in prokaryotes protein dataset using systems modelling # |
| 4 | +# and similarity search. # |
| 5 | +# # |
| 6 | +# Authors: Sophie Abby, Bertrand Neron # |
| 7 | +# Copyright (c) 2014-2025 Institut Pasteur (Paris) and CNRS. # |
| 8 | +# See the COPYRIGHT file for details # |
| 9 | +# # |
| 10 | +# This file is part of MacSyLib package. # |
| 11 | +# # |
| 12 | +# MacSyLib is free software: you can redistribute it and/or modify # |
| 13 | +# it under the terms of the GNU General Public License as published by # |
| 14 | +# the Free Software Foundation, either version 3 of the License, or # |
| 15 | +# (at your option) any later version. # |
| 16 | +# # |
| 17 | +# MacSyLib is distributed in the hope that it will be useful, # |
| 18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
| 19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
| 20 | +# GNU General Public License for more details . # |
| 21 | +# # |
| 22 | +# You should have received a copy of the GNU General Public License # |
| 23 | +# along with MacSyLib (COPYING). # |
| 24 | +# If not, see <https://www.gnu.org/licenses/>. # |
| 25 | +######################################################################### |
| 26 | + |
| 27 | +import subprocess |
| 28 | +from tests import MacsyTest |
| 29 | + |
| 30 | + |
| 31 | +class Test_msl_data(MacsyTest): |
| 32 | + |
| 33 | + def test_help(self): |
| 34 | + |
| 35 | + expected_output = r"""usage: msl_data [-h] [-v] [--version] |
| 36 | + {available,download,install,uninstall,search,info,list,freeze,cite,help,check,show,definition,init}""" |
| 37 | + |
| 38 | + p = subprocess.run("msl_data --help", shell=True, check=True, capture_output=True, text=True, encoding='utf8') |
| 39 | + self.assertEqual(p.returncode, 0) |
| 40 | + # for an unknow reason the output is not exactly formated in same manner on all plateform/execution |
| 41 | + # on some execution some lines ar wrapped |
| 42 | + # on some other no |
| 43 | + # so I test only the beginning of the help message |
| 44 | + self.assertTrue(p.stdout.startswith(expected_output)) |
| 45 | + |
| 46 | + |
| 47 | +class Test_msl_profile(MacsyTest): |
| 48 | + |
| 49 | + def test_help(self): |
| 50 | + |
| 51 | + expected_output = r"""usage: msl_profile [-h] [--coverage-profile COVERAGE_PROFILE] |
| 52 | + [--i-evalue-sel I_EVALUE_SEL] |
| 53 | + [--best-hits {score,i_eval,profile_coverage}] [-p PATTERN] |
| 54 | + [-o OUT] [--index-dir INDEX_DIR] [-f] [-V] [-v] [--mute] |
| 55 | + previous_run |
| 56 | +
|
| 57 | + * * * * * |
| 58 | + * * * * * ** |
| 59 | + ** * * * * * * |
| 60 | + * _ * ** __ _ _ * |
| 61 | + _ __ ___ ___| | _ __ _ __ ___ / _(_) | ___ |
| 62 | + | '_ ` _ \/ __| | | '_ \| '__/ _ \| |_| | |/ _ \ |
| 63 | + | | | | | \__ \ | | |_) | | | (_) | _| | | __/ |
| 64 | + |_| |_| |_|___/_|____| .__/|_| \___/|_| |_|_|\___| |
| 65 | + * |_____|_| * * |
| 66 | + * * * * ** * * * * |
| 67 | + * * * * * * |
| 68 | + * * * * |
| 69 | +
|
| 70 | +msl_profile - MacSyLib profile helper tool |
| 71 | +""" |
| 72 | + p = subprocess.run("msl_profile --help", shell=True, check=True, capture_output=True, text=True, encoding='utf8') |
| 73 | + self.assertEqual(p.returncode, 0) |
| 74 | + self.assertTrue(p.stdout.startswith(expected_output)) |
0 commit comments