cli_test.py 804 B

123456789101112131415161718192021
  1. from __future__ import unicode_literals
  2. from __future__ import absolute_import
  3. from .. import unittest
  4. from fig.cli.main import TopLevelCommand
  5. from fig.packages.six import StringIO
  6. class CLITestCase(unittest.TestCase):
  7. def test_project_name_defaults_to_dirname(self):
  8. command = TopLevelCommand()
  9. command.base_dir = 'tests/fixtures/simple-figfile'
  10. self.assertEquals('simplefigfile', command.project_name)
  11. def test_yaml_filename_check(self):
  12. command = TopLevelCommand()
  13. command.base_dir = 'tests/fixtures/longer-filename-figfile'
  14. self.assertTrue(command.project.get_service('definedinyamlnotyml'))
  15. def test_help(self):
  16. command = TopLevelCommand()
  17. with self.assertRaises(SystemExit):
  18. command.dispatch(['-h'], None)