Пробую экшн - тесты

This commit is contained in:
serafim.urukov 2021-09-16 22:24:13 +03:00
parent a2ad18ca8c
commit 16f044d221
2 changed files with 42 additions and 8 deletions

38
.github/workflow/test_service.yaml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Тест сервиса по Google интеграции
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: "3.x"
# Optional - x64 or x86 architecture, defaults to x64
architecture: "x64"
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
cd ${{ github.workspace }}/SpreadsheetsService
pip install -r requirements.txt
- name: Run tests
run: |
pip install pytest
pytest

View File

@ -35,12 +35,12 @@ STUDENTS = (
class TestStudent:
def test_init(self):
student = Student(1, "Фарид Михайлов")
student = Student(1, "Фарид Михайлов", "42")
assert student.name == "Фарид Михайлов"
assert student.number == 1
def test_student_assignments(self):
student = Student(1, "Фарид Михайлов")
student = Student(1, "Фарид Михайлов", "42")
ass = [Assignment(weight, values) for weight, values in ASSIGNMENTS]
for a in ass:
@ -52,9 +52,10 @@ class TestStudent:
class TestGroup:
@staticmethod
def init_group():
group_id = 5374
group = Group(5374)
for el in STUDENTS:
student = Student(el[0], el[1])
student = Student(el[0], el[1], group_id)
group.add_student(student)
return group
@ -72,8 +73,3 @@ class TestGroup:
students = group.find_students("Йгбо")
assert len(students) == 2
def test_top(self):
group = self.init_group()
group.top(5)