Skip to content

Commit 4b08a37

Browse files
authored
Merge pull request #52 from PyAr/testing
Inicio de testing
2 parents 27f6109 + 010c87f commit 4b08a37

File tree

7 files changed

+32
-8
lines changed

7 files changed

+32
-8
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/setup-python@v3
1111
- name: Install dependencies
1212
run: |
13-
pip install sphinx sphinxcontrib-napoleon sphinx_rtd_theme
13+
pip install sphinx sphinx_rtd_theme
1414
- name: Sphinx build
1515
run: |
1616
sphinx-build -b html docs/source docs/build/html

docs/source/instalacion_entorno.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ Ahora inicie el contenedor:
6363
.. code-block:: bash
6464
6565
docker run -e "TOKEN=TOKEN_PERSONAL" -e "PYCAMP_BOT_MASTER_KEY=KEY" -v ./:/pycamp/telegram_bot --name pycamp_telegram_bot pycamp_bot
66+
67+
Para ejecutar los test:
68+
69+
.. code-block:: bash
70+
71+
docker run --rm -e "TOKEN=TOKEN_PERSONAL" -e "PYCAMP_BOT_MASTER_KEY=KEY" -v ./:/pycamp/telegram_bot --name pycamp_telegram_bot_test pycamp_bot python -m unittest -v test

test/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"""Testing"""
2+
3+
from .test_start import TestStart
4+
5+
__all__ = [
6+
'TestStart',
7+
]

test/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
from telegram import Bot
3+
4+
5+
bot = Bot(token=os.environ['TOKEN'])

test/test_start.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""Test de comandos"""
2+
3+
import os
4+
import unittest
5+
from .conftest import bot
6+
7+
8+
class TestStart(unittest.TestCase):
9+
"""Test de distintos comandos sin lógica"""
10+
11+
def test_start(self):
12+
"""Start"""
13+
bot.send_message(os.environ["CHAT_ID"], '/start')

tests/test_no_test.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)