Skip to content

Instantly share code, notes, and snippets.

@brenorb
Last active May 4, 2019 22:46
Show Gist options
  • Save brenorb/61907d096bfb1d1042b8342b01e339b2 to your computer and use it in GitHub Desktop.
Save brenorb/61907d096bfb1d1042b8342b01e339b2 to your computer and use it in GitHub Desktop.
Python TDD with pytest. https://pytest.org
import twittter_main
# Execute Pytest in the cmd to assert the test.
def test_post_sem_usuario_sem_msg():
assert twittter_main.post('->') == 'Comando invalido!'
def test_post_sem_msg():
assert twittter_main.post("Alice ->") == "Post sem mensagem!"
def test_post_sem_usuario():
assert twittter_main.post("-> Estamos no coding day") == "Post sem usuario!"
def test_post_sem_parametro():
assert twittter_main.post() == "Post sem parametro"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment