eranheres / touch_typing_practice

0 stars 1 forks source link

Sweep: add unit test for main.py #10

Open eranheres opened 8 months ago

eranheres commented 8 months ago

Details

No response

Checklist - [X] Create `tests/test_main.py` ✓ https://github.com/eranheres/touch_typing_practice/commit/3f556cb973ae79392b3a12e8f4163a9bf7d7a726 ![Flowchart](https://raw.githubusercontent.com/eranheres/touch_typing_practice/sweep/assets/772f806fa4d6535915ef345641f0bf13a82106c6e127d1a7d5bf05d991a3d6ef_10_flowchart.svg)
sweep-mine[bot] commented 8 months ago
Sweeping

50%
💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets.

![Docker Version Updated](https://img.shields.io/badge/Docker%20Version%20Updated-8%20minutes%20ago-blue)

Actions (click)

Sandbox Execution ✓

Here are the sandbox execution logs prior to making any changes:

Sandbox logs for adc78b4
trunk init 1/5 ✓
⥿ Downloading Trunk 1.17.2...
⥿ Downloading Trunk 1.17.2...
⢿ Downloading Trunk 1.17.2...
⣝ Downloading Trunk 1.17.2...
⣽ Downloading Trunk 1.17.2...
⣞ Downloading Trunk 1.17.2...
⣡ Downloading Trunk 1.17.2...
✔ Downloading Trunk 1.17.2... done
⥿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⥿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 15 linters were enabled (.trunk/trunk.yaml)
  actionlint 1.6.26 (1 github-workflow file)
  bandit 1.7.5 (9 python files)
  black 23.9.1 (7 python files)
  checkov 3.0.35 (4 yaml files)
  git-diff-check (32 files)
  isort 5.12.0 (9 python files) (created .isort.cfg)
  markdownlint 0.37.0 (4 markdown files) (created .markdownlint.yaml)
  osv-scanner 1.4.3 (1 lockfile file)
  oxipng 9.0.0 (3 png files)
  prettier 3.1.0 (4 markdown, 4 yaml files)
  ruff 0.1.5 (9 python files) (created ruff.toml)
  svgo 3.0.3 (3 svg files) (created svgo.config.js)
  trivy 0.47.0 (4 yaml files)
  trufflehog 3.62.1 (32 files)
  yamllint 1.33.0 (4 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
pip install -r requirements.txt 2/5 ✓
Collecting iniconfig==2.0.0
  Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting packaging==23.2
  Downloading packaging-23.2-py3-none-any.whl (53 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.0/53.0 KB 1.0 MB/s eta 0:00:00
Collecting pluggy==1.3.0
  Downloading pluggy-1.3.0-py3-none-any.whl (18 kB)
Collecting polyglot==16.7.4
  Downloading polyglot-16.7.4.tar.gz (126 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.3/126.3 KB 5.0 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pytest==7.4.3
  Downloading pytest-7.4.3-py3-none-any.whl (325 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 325.1/325.1 KB 17.5 MB/s eta 0:00:00
Requirement already satisfied: tomli>=1.0.0 in /usr/local/lib/python3.10/dist-packages (from pytest==7.4.3->-r requirements.txt (line 5)) (2.0.1)
Collecting exceptiongroup>=1.0.0rc8
  Downloading exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Building wheels for collected packages: polyglot
  Building wheel for polyglot (setup.py): started
  Building wheel for polyglot (setup.py): finished with status 'done'
  Created wheel for polyglot: filename=polyglot-16.7.4-py2.py3-none-any.whl size=52577 sha256=83b3afe7199273c9c737bb3939aff70c09eb6e412cc9f457a00425441261f679
  Stored in directory: /root/.cache/pip/wheels/aa/92/4a/b172589446ba537db3bdb9a1f2204f27fe71217981c14ac368
Successfully built polyglot
Installing collected packages: polyglot, pluggy, packaging, iniconfig, exceptiongroup, pytest
  Attempting uninstall: packaging
    Found existing installation: packaging 23.1
    Uninstalling packaging-23.1:
      Successfully uninstalled packaging-23.1
Successfully installed exceptiongroup-1.1.3 iniconfig-2.0.0 packaging-23.2 pluggy-1.3.0 polyglot-16.7.4 pytest-7.4.3
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
trunk fmt tests/test_main.py || return 0 3/5 ✓
  NOTICES  
 tests/test_main.py  ignored empty file [black]
 Hint: use --force to check ignored files
Checked 1 file
✔ No issues
trunk check --fix --print-failures tests/test_main.py 4/5 ✓
  NOTICES  
 tests/test_main.py  ignored empty file [black]
 Hint: use --force to check ignored files
Checked 1 file
✔ No issues
pytest 5/5 ✓
============================= test session starts ==============================
platform linux -- Python 3.10.12, pytest-7.4.3, pluggy-1.3.0
rootdir: /repo
collected 16 items
tests/test_session.py .....                                              [ 31%]
tests/test_typing_practice.py ......                                     [ 68%]
tests/test_user.py .....                                                 [100%]
============================== 16 passed in 1.15s ==============================

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/eranheres/touch_typing_practice/blob/adc78b4e809050fe3a71f9da27671893ea93fe07/touch_typing_practice/main.py#L1-L44 https://github.com/eranheres/touch_typing_practice/blob/adc78b4e809050fe3a71f9da27671893ea93fe07/tests/test_session.py#L1-L64

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

Working on it...


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord