def test_include_twice(self): out_path = self.get_tmp_path() sys.argv = ['wfc', '-o', out_path, '-q', '-w', SAMPLES_HOME, 'first-include.flow', 'second-include.flow'] self.assertEqual(0, cli.main())
def try_to_compile(self, *flows): with open(self.output, 'w') as output: sys.stderr = output sys.argv = ['wfc', '-w', SAMPLES_HOME, ' '.join(flows)] cli.main()
def test_compile_with_syntax_errors(self): sys.argv = ['wfc', '-q', '-w', SAMPLES_HOME, 'ask-bad-syntax.flow'] self.assertEqual(1, cli.main())
def test_try_to_compile_a_directory(self): sys.argv = ['wfc', '-q', SAMPLES_HOME] self.assertEqual(errno.EISDIR, cli.main())
def test_run_main_with_several_modules(self): sys.argv = ['wfc', '-o', os.path.devnull, '-q', '-w', SAMPLES_HOME, 'ask.flow', 'say.flow'] self.assertEqual(0, cli.main())
def test_run_main_with_workdir_not_a_dir(self): sys.argv = ['wfc', '-q', '-w', __file__] self.assertEqual(errno.ENOTDIR, cli.main())
def test_run_main_with_ghost_workdir(self): sys.argv = ['wfc', '-q', '-w', SAMPLES_HOME + '/does-not-exist'] self.assertEqual(errno.ENOENT, cli.main())