Closed github-actions[bot] closed 4 months ago
I am not sure why, but I had issues importing the Hand class in the test_hand.py so added the following workaround:
import sys
import os
# Add the src directory to the Python path
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'src'))
from modules.hand import Hand
Start by setting up a development branch for this issue
Create a separate folder
src/modules
to hold our classes. be sure to add an empty file__init__.py
.Then add a file in that folder
src/modules/hand.py
and cut theHand
class out of thesrc/rps_game-py
file and paste it into it:In the
rps_game.py
file, which no longer knows of theHand
class add an import statement:In the
tests/test_hand.py
unit test the import ofHand
must point to it's new loaction:Run the tests again - and try to run the script again.
Is it working?
Wrap up the development branch and deliver it to
main