Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a879e4

Browse files
author
renzon
committed
Rodando testes de atores pelo console
1 parent f9d0e43 commit 9a879e4

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

testes/atores_testes.py

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
# -*- coding: utf-8 -*-
22

33
from __future__ import unicode_literals
4+
5+
import sys
6+
from os import path
7+
import unittest
8+
9+
project_dir = path.dirname(__file__)
10+
project_dir = path.join('..')
11+
sys.path.append(project_dir)
12+
13+
project_dir = path.join(path.dirname(__file__), '..')
14+
project_dir = path.normpath(project_dir)
15+
sys.path.append(project_dir)
416
from unittest.case import TestCase
517
from atores import Ator, DESTRUIDO, ATIVO, Obstaculo, Porco, PassaroAmarelo, PassaroVermelho
618

@@ -681,3 +693,7 @@ def test_lancamento_45_graus(self):
681693
# t = 2 + (delta_t / 100)
682694
# x, y = passaro_amarelo.calcular_posicao(t)
683695
# print(' self.assert_passaro_posicao(%s, %s, ATIVO, passaro_amarelo, %s)' % (x, y, t))
696+
697+
698+
if __name__ == '__main__':
699+
unittest.main()

testes/fase_testes.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
# -*- coding: utf-8 -*-
2-
from itertools import chain
32

43
import os
54
from os import path
5+
import unittest
66
from unittest.case import TestCase
77
import math
88
import sys
99

1010
project_dir = path.dirname(__file__)
1111
project_dir = path.join('..')
1212
sys.path.append(project_dir)
13-
from placa_grafica_tkinter import rodar_fase
1413

1514
project_dir = os.path.join(os.path.dirname(__file__), '..')
1615
project_dir = os.path.normpath(project_dir)
1716
sys.path.append(project_dir)
1817

19-
from atores import Obstaculo, Porco, PassaroVermelho, PassaroAmarelo, DESTRUIDO, ATIVO
18+
from atores import Obstaculo, Porco, PassaroVermelho, PassaroAmarelo, DESTRUIDO
2019
from fase import Fase, Ponto
2120

2221

@@ -221,4 +220,4 @@ def criar_fase_exemplo(multiplicador=1):
221220

222221

223222
if __name__ == '__main__':
224-
rodar_fase(criar_fase_exemplo(10))
223+
unittest.main()

0 commit comments

Comments
 (0)