Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Format Code #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions 01_hello/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
from subprocess import getstatusoutput, getoutput

prg = './hello.py'
prg = "./hello.py"


# --------------------------------------------------
Expand All @@ -18,34 +18,34 @@ def test_exists():
def test_runnable():
"""Runs using python3"""

out = getoutput(f'python3 {prg}')
assert out.strip() == 'Hello, World!'
out = getoutput(f"python3 {prg}")
assert out.strip() == "Hello, World!"


# --------------------------------------------------
def test_executable():
"""Says 'Hello, World!' by default"""

out = getoutput(prg)
assert out.strip() == 'Hello, World!'
assert out.strip() == "Hello, World!"


# --------------------------------------------------
def test_usage():
"""usage"""

for flag in ['-h', '--help']:
rv, out = getstatusoutput(f'{prg} {flag}')
for flag in ["-h", "--help"]:
rv, out = getstatusoutput(f"{prg} {flag}")
assert rv == 0
assert out.lower().startswith('usage')
assert out.lower().startswith("usage")


# --------------------------------------------------
def test_input():
"""test for input"""

for val in ['Universe', 'Multiverse']:
for option in ['-n', '--name']:
rv, out = getstatusoutput(f'{prg} {option} {val}')
for val in ["Universe", "Multiverse"]:
for option in ["-n", "--name"]:
rv, out = getstatusoutput(f"{prg} {option} {val}")
assert rv == 0
assert out.strip() == f'Hello, {val}!'
assert out.strip() == f"Hello, {val}!"