GeezerVison is showing github.com — Refactor para pássaros sumirem · pythonprobr/pythonbirds@a70028f
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: atores.py +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 |
| 10 | 10 | class Ator(): | 11 | 11 | _caracter_ativo = 'A' | 12 | | - _caracter_destruido = '+' | | 12 | + _caracter_destruido = ' ' | 13 | 13 |
| 14 | 14 | def caracter(self, tempo): | 15 | 15 | if self.status(tempo) == ATIVO: | @@ -51,11 +51,11 @@ def esta_no_intervalo(coordenada1, coordenada2, intervalo=1): | 51 | 51 |
| 52 | 52 | class Obstaculo(Ator): | 53 | 53 | _caracter_ativo = 'O' | 54 | | - _caracter_destruido = ' ' | 55 | 54 |
| 56 | 55 |
| 57 | 56 | class Porco(Ator): | 58 | 57 | _caracter_ativo = '@' | | 58 | + _caracter_destruido = '+' | 59 | 59 |
| 60 | 60 |
| 61 | 61 | GRAVIDADE = 10 # m/s^2 | |
Collapse file Copy file name to clipboardExpand all lines: testes/atores_testes.py +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -88,7 +88,7 @@ def teste_colisao_somente_um_ator_destruido(self): | 88 | 88 |
| 89 | 89 | def teste_status(self): | 90 | 90 | ator = Ator() | 91 | | - assert_ator_status(self, ator, 'A', '+') | | 91 | + assert_ator_status(self, ator, 'A', ' ') | 92 | 92 |
| 93 | 93 |
| 94 | 94 | class ObstaculoTestes(TestCase): | @@ -129,7 +129,7 @@ def teste_posicao_antes_do_lancamento(self): | 129 | 129 |
| 130 | 130 | def teste_status(self): | 131 | 131 | passaro_amarelo = PassaroVermelho(1, 1) | 132 | | - assert_ator_status(self, passaro_amarelo, 'D', '+') | | 132 | + assert_ator_status(self, passaro_amarelo, 'D', ' ') | 133 | 133 |
| 134 | 134 | def teste_colisao_com_chao(self): | 135 | 135 | for i in range(30): | @@ -163,7 +163,7 @@ def teste_posicao_antes_do_lancamento(self): | 163 | 163 |
| 164 | 164 | def teste_status(self): | 165 | 165 | passaro_amarelo = PassaroAmarelo(1, 1) | 166 | | - assert_ator_status(self, passaro_amarelo, '>', '+') | | 166 | + assert_ator_status(self, passaro_amarelo, '>', ' ') | 167 | 167 |
| 168 | 168 | def teste_colisao_com_chao(self): | 169 | 169 | for i in range(30): | |
Collapse file Copy file name to clipboardExpand all lines: testes/fase_testes.py +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -131,15 +131,15 @@ def teste_calcular_pontos(self): | 131 | 131 | Ponto(70, 1, '@')] | 132 | 132 | self.assertListEqual(expected, fase_exemplo.calcular_pontos(0)) | 133 | 133 |
| 134 | | - expected = [Ponto(31, 11, '+'), Ponto(17, 25, '>'), Ponto(3, 3, '>'), Ponto(31, 10, ' '), Ponto(78, 1, '@'), | | 134 | + expected = [Ponto(31, 11, ' '), Ponto(17, 25, '>'), Ponto(3, 3, '>'), Ponto(31, 10, ' '), Ponto(78, 1, '@'), | 135 | 135 | Ponto(70, 1, '@')] | 136 | 136 | self.assertListEqual(expected, fase_exemplo.calcular_pontos(4)) | 137 | 137 |
| 138 | | - expected = [Ponto(31, 11, '+'), Ponto(57, 30, '>'), Ponto(69, 2, '+'), Ponto(31, 10, ' '), Ponto(78, 1, '@'), | | 138 | + expected = [Ponto(31, 11, ' '), Ponto(57, 30, '>'), Ponto(69, 2, ' '), Ponto(31, 10, ' '), Ponto(78, 1, '@'), | 139 | 139 | Ponto(70, 1, '+')] | 140 | 140 | self.assertListEqual(expected, fase_exemplo.calcular_pontos(7)) | 141 | 141 |
| 142 | | - expected = [Ponto(31, 11, '+'), Ponto(77, 2, '+'), Ponto(69, 2, '+'), Ponto(31, 10, ' '), Ponto(78, 1, '+'), | | 142 | + expected = [Ponto(31, 11, ' '), Ponto(77, 2, ' '), Ponto(69, 2, ' '), Ponto(31, 10, ' '), Ponto(78, 1, '+'), | 143 | 143 | Ponto(70, 1, '+')] | 144 | 144 | self.assertListEqual(expected, fase_exemplo.calcular_pontos(8.5)) | 145 | 145 |
| |
|