eranheres / touch_typing_practice

0 stars 1 forks source link

Sweep: refactor main.py #17

Open eranheres opened 11 months ago

eranheres commented 11 months ago

Details

Refactor the code so main.py will include only initialization. The remaining functionalities should go into frontend.py which will be a class that handles the frontend functions. create a testing for the frontend class Create pytest for frontend.py

Checklist - [X] Refactor `touch_typing_practice/main.py` ✗ - [X] Modify `touch_typing_practice/main.py` ✓ https://github.com/eranheres/touch_typing_practice/commit/8355e8eea34517802a58d92860d444821af9a624 - [X] Test `tests/test_frontend.py` ✗ ![Flowchart](https://raw.githubusercontent.com/eranheres/touch_typing_practice/sweep/assets/213d27c3408698e399e6573c4ea51f3cf2c0e9d9ebb5e9175619621e88709a9b_17_flowchart.svg)
sweep-mine[bot] commented 11 months ago

Here's the PR! https://github.com/eranheres/touch_typing_practice/pull/18.

💎 Sweep Pro: I'm using GPT-4. You have unlimited GPT-4 tickets. (tracking ID: efbd8aae96)

Actions (click)

Sandbox Execution ✓

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

Sandbox logs for edd9fa1
trunk fmt touch_typing_practice/main.py || return 0 1/3 ✓
  NOTICES  
 touch_typing_practice/main.py  ignored empty file [black]
 Hint: use --force to check ignored files
Checked 1 file
✔ No issues
Run trunk upgrade to upgrade 1 linter
trunk check --fix --print-failures touch_typing_practice/main.py 2/3 ✓
  NOTICES  
 touch_typing_practice/main.py  ignored empty file [black]
 Hint: use --force to check ignored files
Checked 1 file
✔ No issues
pytest 3/3 ✓
============================= 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.17s ==============================

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/edd9fa1cc00242c1f79072aba7e3f2b412974802/touch_typing_practice/main.py#L1-L44 https://github.com/eranheres/touch_typing_practice/blob/edd9fa1cc00242c1f79072aba7e3f2b412974802/tests/test_session.py#L1-L64

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/refactor-frontend.


🎉 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