This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from urllib import urlencode | |
class StarWarsGatewaySWAPI(object): | |
URL = 'http://swapi.co/api/' | |
def __init__(self, client_http): | |
self.client = client_http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [...] | |
def verificar_pangrama(frase): | |
for letra in string.ascii_lowercase: | |
if letra not in frase.lower(): | |
return False | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
def verificar_pangrama(frase): | |
for letra in string.ascii_lowercase: | |
if letra not in frase: | |
return False | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [...] | |
def test_retorna_falso_quando_frase_nao_eh_pangrama(self): | |
frase = "Frase que não é um pangrama" | |
frase_eh_pangrama = verificar_pangrama(frase) | |
self.assertFalse(frase_eh_pangrama) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verificar_pangrama(frase): | |
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verificar_pangrama(frase): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from verificar_pangrama import verificar_pangrama | |
# [...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def verificar_pangrama(): | |
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [...] | |
def test_retorna_verdadeiro_quando_frase_pangrama(self): | |
frase = "Zebras caolhas de Java querem mandar fax para moça gigante de New York" | |
frase_eh_pangrama = verificar_pangrama(frase) | |
self.assertTrue(frase_eh_pangrama) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# [...] | |
def test_retorna_verdadeiro_quando_frase_pangrama(self): | |
# Arrange | |
frase = "Zebras caolhas de Java querem mandar fax para moça gigante de New York" | |
# Act | |
frase_eh_pangrama = verificar_pangrama(frase) | |
# Assert | |
self.assertEqual(True, frase_eh_pangrama) |