| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | from __future__ import unicode_literalsfrom __future__ import absolute_importimport loggingimport osfrom .. import unittestfrom fig.cli import mainfrom fig.cli.main import TopLevelCommandfrom fig.packages.six import StringIOclass CLITestCase(unittest.TestCase):    def test_default_project_name(self):        cwd = os.getcwd()        try:            os.chdir('tests/fixtures/simple-figfile')            command = TopLevelCommand()            self.assertEquals('simplefigfile', command.project_name)        finally:            os.chdir(cwd)    def test_project_name_with_explicit_base_dir(self):        command = TopLevelCommand()        command.base_dir = 'tests/fixtures/simple-figfile'        self.assertEquals('simplefigfile', command.project_name)    def test_project_name_with_explicit_project_name(self):        command = TopLevelCommand()        command.explicit_project_name = 'explicit-project-name'        self.assertEquals('explicitprojectname', command.project_name)    def test_yaml_filename_check(self):        command = TopLevelCommand()        command.base_dir = 'tests/fixtures/longer-filename-figfile'        self.assertTrue(command.project.get_service('definedinyamlnotyml'))    def test_help(self):        command = TopLevelCommand()        with self.assertRaises(SystemExit):            command.dispatch(['-h'], None)    def test_setup_logging(self):        main.setup_logging()        self.assertEqual(logging.getLogger().level, logging.DEBUG)        self.assertEqual(logging.getLogger('requests').propagate, False)
 |