Skip to content

Commit c8e6596

Browse files
Update index.html
1 parent fa8e7eb commit c8e6596

1 file changed

Lines changed: 161 additions & 24 deletions

File tree

docs/index.html

Lines changed: 161 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,143 @@ <h1>Test-Driven Development with Python</h1>
830830
</div>
831831
</div>
832832

833+
<div class="container">
834+
835+
<section id="frameworks" class="section">
836+
<h2 class="section-title">Testing Frameworks</h2>
837+
<p class="section-subtitle">Comprehensive guides for Python's most popular testing frameworks</p>
838+
839+
<div class="framework-section">
840+
<div class="framework-card">
841+
<h3 class="framework-name"><i class="fas fa-vial"></i> unittest</h3>
842+
<p style="color: var(--gray); margin-bottom: 2rem;">Python's built-in testing framework. No installation required.</p>
843+
844+
<h4 style="margin: 1.5rem 0 1rem;">Installation</h4>
845+
<div class="command-box">Built-in - no installation needed!</div>
846+
847+
<h4 style="margin: 1.5rem 0 1rem;">Quick Start</h4>
848+
<div class="code-block">import unittest
849+
850+
class TestCalculator(unittest.TestCase):
851+
def test_addition(self):
852+
self.assertEqual(2 + 2, 4)
853+
854+
if __name__ == '__main__':
855+
unittest.main()</div>
856+
857+
<div class="command-box">python -m unittest test_module.py</div>
858+
</div>
859+
860+
<div class="framework-card">
861+
<h3 class="framework-name"><i class="fas fa-nose"></i> nose2</h3>
862+
<p style="color: var(--gray); margin-bottom: 2rem;">Extended testing with automatic test discovery.</p>
863+
864+
<div class="command-box">pip install nose2</div>
865+
<div class="command-box">nose2 -v</div>
866+
</div>
867+
868+
<div class="framework-card">
869+
<h3 class="framework-name"><i class="fas fa-flask"></i> pytest (Recommended)</h3>
870+
<p style="color: var(--gray); margin-bottom: 2rem;">Modern, feature-rich testing framework - industry standard.</p>
871+
872+
<div class="command-box">pip install pytest pytest-cov</div>
873+
874+
<h4 style="margin: 1.5rem 0 1rem;">Quick Start</h4>
875+
<div class="code-block">def test_addition():
876+
assert 2 + 2 == 4
877+
878+
def test_division():
879+
assert 10 / 2 == 5</div>
880+
881+
<div class="command-box">pytest -v --cov=mypackage</div>
882+
</div>
883+
</div>
884+
</section>
885+
886+
<section id="examples" class="section">
887+
<h2 class="section-title">Example Projects</h2>
888+
<p class="section-subtitle">Learn from complete, real-world examples</p>
889+
890+
<div class="project-grid">
891+
<div class="project-card">
892+
<div class="project-header">
893+
<div class="project-icon">📱</div>
894+
<h3 class="project-title">Calculator</h3>
895+
</div>
896+
<div class="project-body">
897+
<p style="color: var(--gray); margin-bottom: 1rem;">Basic calculator with comprehensive tests covering all operations and error handling.</p>
898+
<strong>Framework:</strong> unittest
899+
</div>
900+
</div>
901+
902+
<div class="project-card">
903+
<div class="project-header">
904+
<div class="project-icon">🏨</div>
905+
<h3 class="project-title">Booking System</h3>
906+
</div>
907+
<div class="project-body">
908+
<p style="color: var(--gray); margin-bottom: 1rem;">Hotel room booking with availability checks, cancellations, and pricing.</p>
909+
<strong>Framework:</strong> unittest
910+
</div>
911+
</div>
912+
913+
<div class="project-card">
914+
<div class="project-header">
915+
<div class="project-icon">🛒</div>
916+
<h3 class="project-title">Shopping Cart</h3>
917+
</div>
918+
<div class="project-body">
919+
<p style="color: var(--gray); margin-bottom: 1rem;">Shopping cart with multiple discount strategies (BOGO, percentage, fixed).</p>
920+
<strong>Framework:</strong> unittest
921+
</div>
922+
</div>
923+
924+
<div class="project-card">
925+
<div class="project-header">
926+
<div class="project-icon">📁</div>
927+
<h3 class="project-title">Folder Lists</h3>
928+
</div>
929+
<div class="project-body">
930+
<p style="color: var(--gray); margin-bottom: 1rem;">File system navigation demonstrating TDD with I/O operations.</p>
931+
<strong>Framework:</strong> unittest
932+
</div>
933+
</div>
934+
</div>
935+
</section>
936+
937+
<section class="section">
938+
<h2 class="section-title">Framework Comparison</h2>
939+
940+
<table class="comparison-table">
941+
<thead>
942+
<tr>
943+
<th>Framework</th>
944+
<th>Best For</th>
945+
<th>Status</th>
946+
</tr>
947+
</thead>
948+
<tbody>
949+
<tr>
950+
<td><strong>unittest</strong></td>
951+
<td>No dependencies, OOP structure, legacy code</td>
952+
<td>✅ Active</td>
953+
</tr>
954+
<tr>
955+
<td><strong>nose / nose2</strong></td>
956+
<td>Legacy projects, automatic discovery</td>
957+
<td>⚠️ Maintenance</td>
958+
</tr>
959+
<tr>
960+
<td><strong>pytest</strong></td>
961+
<td>Modern projects, rich features, plugins</td>
962+
<td>🌟 Recommended</td>
963+
</tr>
964+
</tbody>
965+
</table>
966+
</section>
967+
</div>
968+
969+
833970
<!-- TDD Cycle Section -->
834971
<div class="container">
835972
<section id="intro" class="section fade-in">
@@ -917,30 +1054,30 @@ <h3 class="feature-title">Team Collaboration</h3>
9171054

9181055

9191056

920-
<footer>
921-
<div style="max-width: 1200px; margin: 0 auto;">
922-
<div class="logo" style="justify-content: center; margin-bottom: 2rem;">
923-
<i class="fas fa-flask"></i>
924-
<span>TDD Python</span>
925-
</div>
926-
<p style="font-size: 1.1rem; margin-bottom: 2rem;">Test-Driven Development with Python - MIT License</p>
927-
928-
<div class="footer-social">
929-
<a href="https://github.com/Carrington-dev/test-driven-development-with-python" class="social-link">
930-
<i class="fab fa-github"></i>
931-
</a>
932-
<a href="https://www.linkedin.com/in/carrington-muleya" class="social-link">
933-
<i class="fab fa-linkedin"></i>
934-
</a>
935-
<a href="https://twitter.com" class="social-link">
936-
<i class="fab fa-twitter"></i>
937-
</a>
938-
</div>
939-
940-
<p style="margin-top: 2rem; opacity: 0.7;">© 2025 Carrington Muleya</p>
941-
</div>
942-
</footer>
943-
1057+
9441058
</div>
1059+
<footer>
1060+
<div style="max-width: 1200px; margin: 0 auto;">
1061+
<div class="logo" style="justify-content: center; margin-bottom: 2rem;">
1062+
<i class="fas fa-flask"></i>
1063+
<span>TDD Python</span>
1064+
</div>
1065+
<p style="font-size: 1.1rem; margin-bottom: 2rem;">Test-Driven Development with Python - MIT License</p>
1066+
1067+
<div class="footer-social">
1068+
<a href="https://github.com/Carrington-dev/test-driven-development-with-python" class="social-link">
1069+
<i class="fab fa-github"></i>
1070+
</a>
1071+
<a href="https://www.linkedin.com/in/carrington-muleya" class="social-link">
1072+
<i class="fab fa-linkedin"></i>
1073+
</a>
1074+
<a href="https://twitter.com" class="social-link">
1075+
<i class="fab fa-twitter"></i>
1076+
</a>
1077+
</div>
1078+
1079+
<p style="margin-top: 2rem; opacity: 0.7;">© 2025 Carrington Muleya</p>
1080+
</div>
1081+
</footer>
9451082
</body>
9461083
</html>

0 commit comments

Comments
 (0)