test_hsyclibs.py 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. """Tests for `hsyclibs` package."""
  3. import pytest
  4. from click.testing import CliRunner
  5. from hsyclibs import hsyclibs
  6. from hsyclibs import cli
  7. @pytest.fixture
  8. def response():
  9. """Sample pytest fixture.
  10. See more at: http://doc.pytest.org/en/latest/fixture.html
  11. """
  12. # import requests
  13. # return requests.get('https://github.com/audreyr/cookiecutter-pypackage')
  14. def test_content(response):
  15. """Sample pytest test function with the pytest fixture as an argument."""
  16. # from bs4 import BeautifulSoup
  17. # assert 'GitHub' in BeautifulSoup(response.content).title.string
  18. def test_command_line_interface():
  19. """Test the CLI."""
  20. runner = CliRunner()
  21. result = runner.invoke(cli.main)
  22. assert result.exit_code == 0
  23. assert 'hsyclibs.cli.main' in result.output
  24. help_result = runner.invoke(cli.main, ['--help'])
  25. assert help_result.exit_code == 0
  26. assert '--help Show this message and exit.' in help_result.output