Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 🚀Doxygen

on:
pull_request:
types:
- opened

jobs:
run:
name: 🚀 Doxygen
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Deps
run: |
sudo apt install -y doxygen
- name: Generate Doxygen
shell: bash
run: |
doxygen Doxyfile
- name: Upload
uses: actions/upload-artifact@v2
with:
name: doxygen
path: html
6 changes: 4 additions & 2 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: 🚀 Run

on:
workflow_dispatch:
pull_request:
types:
- opened

jobs:
run:
Expand All @@ -16,4 +18,4 @@ jobs:
- name: 🚀 Run
shell: bash
run: |
python3 main.py
python3 -m unittest test_tree.py
23 changes: 23 additions & 0 deletions test_tree.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import unittest
from node import Node
from tree import Tree

class TestTree(unittest.TestCase):
def test_find_data_in_tree(self):
tree = Tree()
tree.add(5)
tree.add(3)
tree.add(7)
node = tree.find(3)
self.assertEqual(node.data, 3)

def test_find_data_not_in_tree(self):
tree = Tree()
tree.add(5)
tree.add(3)
tree.add(7)
node = tree.find(10)
self.assertIsNone(node)

if __name__ == '__main__':
unittest.main()