Skip to content

Commit 6e2649a

Browse files
🤪 add setup.cfg
Issue: #6
1 parent e3bfa9e commit 6e2649a

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

1build

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def run(build_file_name, arguments):
6565

6666

6767
def execute(command):
68-
print("---------------------------------------------------")
69-
print ("Name: " + command.name)
70-
print ("Command: " + command.cmd)
71-
print("---------------------------------------------------")
68+
print(dash)
69+
print("Name: " + command.name)
70+
print("Command: " + command.cmd)
71+
print(dash)
7272
os.system(command.cmd)
7373

7474

@@ -91,7 +91,7 @@ def __parse_project_config__():
9191
except:
9292
raise ValueError(
9393
"Error in parsing " + __buildFileName__() + " config file. Make sure file is in correct format.\nSample format is:\n\n" +
94-
"---------------------------------------------------\n" + sample_yaml_file() + "\n---------------------------------------------------\n"
94+
dash + "\n" + sample_yaml_file() + "\n" + dash + "\n"
9595
)
9696
else:
9797
raise ValueError("No " + __buildFileName__() + " file found in current directory.")
@@ -118,4 +118,6 @@ def sample_yaml_file():
118118
" - lint: ./gradlew spotlessApply"
119119

120120

121+
dash = '-' * 50
122+
121123
run(BUILD_FILE_NAME, sys.argv)

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = 1

tests/test_1build.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55

66
build = imp.load_source('1build', '1build')
77

8+
dash = '-' * 50
9+
810

911
def test_build_successful_command(capsys):
1012
build.run("tests/build_file.yaml", ['file_name', 'build'])
1113
captured = capsys.readouterr()
12-
expected_message = "---------------------------------------------------\n" \
13-
"Name: build\n" \
14-
"Command: ls\n" \
15-
"---------------------------------------------------\n"
14+
expected_message = "" + dash + "\n" \
15+
"Name: build\n" \
16+
"Command: ls\n" \
17+
+ dash + "\n"
1618
assert expected_message in captured.out
1719

1820

@@ -22,12 +24,12 @@ def test_should_fail_with_invalid_file_message_if_file_is_not_in_correct_yaml_fo
2224

2325
invalid_file_error_message = "Error in parsing 'tests/invalid_yaml_file.yaml' config file. Make sure file is in correct format.\n" \
2426
"Sample format is:\n\n" \
25-
"---------------------------------------------------\n" \
26-
"project: Sample Project\n" \
27-
"commands:\n" \
28-
" - build: ./gradlew clean build\n" \
29-
" - lint: ./gradlew spotlessApply\n" \
30-
"---------------------------------------------------"
27+
+ dash + "\n" \
28+
"project: Sample Project\n" \
29+
"commands:\n" \
30+
" - build: ./gradlew clean build\n" \
31+
" - lint: ./gradlew spotlessApply\n" \
32+
+ dash
3133

3234
assert invalid_file_error_message in captured.out
3335

0 commit comments

Comments
 (0)