==========================================
Python version for which code has been run is Python 3.6
Virtualenv is advised to test the code. Create virtualenv outside the mavericks folder.
Steps:
pip install virtualenv
virtualenv -p /path/to/python3.6 venv
source venv/bin/activate
Requirements are listed in : requirements.txt file
pip install -r requirements.txt
- Once a ROOT node is added, another won't be added.
- No parent to the ROOT node will be added.
- List of supported relations in the PDF does not mention some relations like Husband, Wife
- Names are unique. Any new member added will also have a unique name.
- Relations other than those mentioned in the PDF won't be supported
- Input would be of the format: Two parts, separated by spaces, and each part separated by '=' sign with no spaces in between for querying - Person=Name Relation=relation for adding - Relation=Name Matching_Relation=Name
- Partners not related by blood will not be part of the output other than for Uncle/Aunt
- Non-blood related partners need to be added after adding partner.
After installing dependencies, script can be run as follows:
cd familyTree
python3 family_tree.py
On running this, a prepopulated tree will be shown. You can query/add to this tree. Refer to assumptions for query construction.
To continue querying/adding, you can select 'y' on command prompt:
Do you want to Continue? Type "y" to continue
Test cases can be run using below command:
python3 -m pytest --cov=.
To generate coverage report html files, run:
python3 -m pytest --cov=. --cov-report html
You can check the last run coverage report file in htmlcov. Open the index.html to view detailed report of hits and misses.
Warnings in test cases are for this - pytest fixtures