def test_project(inputs, mkdir): mkdir.return_value = 0 inputs.return_value = dict(project_name='test-me') yehua_file = get_yehua_file() project = Project(yehua_file) project.create_all_directories() calls = mkdir.call_args_list calls = [str(call) for call in calls] expected = [ "call('test-me')", "call('test-me/test_me')", "call('test-me/tests')", "call('test-me/docs')", "call('test-me/docs/source')", "call('test-me/.moban.d')", "call('test-me/.moban.d/tests')", "call('test-me/.moban.d/docs')", "call('test-me/.moban.d/docs/source')" ] eq_(calls, expected)
def main(): argument = None yehua_file = None if len(sys.argv) == 2: argument = sys.argv[1] if argument == "help": usage() else: yehua_file = argument else: yehua_file = get_yehua_file() project = Project(yehua_file) project.create_all_directories() project.templating() project.copy_static_files()
def test_project(inputs, mkdir): mkdir.return_value = 0 inputs.return_value = dict( project_name='test-me' ) yehua_file = get_yehua_file() project = Project(yehua_file) project.create_all_directories() calls = mkdir.call_args_list calls = [str(call) for call in calls] expected = [ "call('test-me')", "call('test-me/test_me')", "call('test-me/tests')", "call('test-me/docs')", "call('test-me/docs/source')", "call('test-me/.moban.d')", "call('test-me/.moban.d/tests')", "call('test-me/.moban.d/docs')", "call('test-me/.moban.d/docs/source')" ] eq_(calls, expected)
def test_existing_directory(inputs, mkdir): mkdir.return_value = 0 inputs.return_value = dict(project_name="yehua") yehua_file = get_yehua_file() project = Project(yehua_file) project.create_all_directories()