Пример #1
0
def test_clusterplot(tmpdir):
    main([
        'clusterplot', '-m', '10',
        datapath('clusterplot.tab.gz'),
        str(tmpdir)
    ])
    assert tmpdir.join('IGHV1-1801.png').check()
Пример #2
0
 def _run(args, expected):
     """
     Run IgDiscover, redirecting stdout to a temporary file.
     Then compare the output with the contents of an expected file.
     """
     outpath = str(tmpdir.join('output'))
     print('Running:', ' '.join(args))
     with open(outpath, 'w') as f:
         old_stdout = sys.stdout
         sys.stdout = f
         main(args)
         sys.stdout = old_stdout
     assert files_equal(expected, outpath)
Пример #3
0
def run(args, expected):
    """
	Run IgDiscover, redirecting stdout to a temporary file.
	Then compare the output with the contents of an expected file.
	"""
    with TemporaryDirectory() as td:
        outpath = os.path.join(td, 'output')
        print('Running:', ' '.join(args))
        with open(outpath, 'w') as f:
            old_stdout = sys.stdout
            sys.stdout = f
            main(args)
            sys.stdout = old_stdout
        assert files_equal(expected, outpath)
Пример #4
0
def test_main():
    with pytest.raises(SystemExit) as exc:
        main(['--version'])
    assert exc.value.code == 0
Пример #5
0
def test_main():
    with assert_raises(SystemExit) as exc:
        main(['--version'])
    assert exc.exception.code == 0