Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3 

4"""Tests for `gutools` package.""" 

5 

6import pytest 

7 

8from click.testing import CliRunner 

9 

10from gutools import tools 

11from gutools import cli 

12 

13 

14@pytest.fixture 

15def response(): 

16 """Sample pytest fixture. 

17 

18 See more at: http://doc.pytest.org/en/latest/fixture.html 

19 """ 

20 # import requests 

21 # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') 

22 

23 

24def test_content(response): 

25 """Sample pytest test function with the pytest fixture as an argument.""" 

26 # from bs4 import BeautifulSoup 

27 # assert 'GitHub' in BeautifulSoup(response.content).title.string 

28 

29 

30def test_command_line_interface(): 

31 """Test the CLI.""" 

32 runner = CliRunner() 

33 result = runner.invoke(cli.main) 

34 assert result.exit_code == 0 

35 assert 'gutools.cli.main' in result.output 

36 help_result = runner.invoke(cli.main, ['--help']) 

37 assert help_result.exit_code == 0 

38 assert '--help Show this message and exit.' in help_result.output