From 820a83dcf3099aebd019fa8ded4325bee4c42cfa Mon Sep 17 00:00:00 2001 From: RamonColmenares Date: Wed, 25 Dec 2024 20:41:58 -0500 Subject: [PATCH] Fix: issue with markdown git pipeline add: tests module and 1 test example, also tests collaboration md --- collaboration/guide/0_repository_setup.md | 3 +- solutions/tests/README.md | 58 +++++++++++++++++++++++ solutions/tests/__init__.py | 0 solutions/tests/test_example.py | 11 +++++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 solutions/tests/__init__.py create mode 100644 solutions/tests/test_example.py diff --git a/collaboration/guide/0_repository_setup.md b/collaboration/guide/0_repository_setup.md index 4044fe979..919c035d5 100644 --- a/collaboration/guide/0_repository_setup.md +++ b/collaboration/guide/0_repository_setup.md @@ -14,7 +14,8 @@ repository and configure it for collaboration: - Change your [repository description](https://stackoverflow.com/questions/7757751/how-do-you-change-a-repository-description-on-github) - Add or remove topics from your repository - - Update your main README with your group name and an initial overview of your project. (You can change this as much as you want.) + - Update your main README with your group name and an initial overview + (You can change this as much as you want.) - Under settings in your repository select: - _Issues_ - _Discussions_ diff --git a/solutions/tests/README.md b/solutions/tests/README.md index 007eb9551..b6eefe12e 100644 --- a/solutions/tests/README.md +++ b/solutions/tests/README.md @@ -1 +1,59 @@ # Tests + +This directory contains the unit tests for the project. +The tests are written using the `unittest` framework. + +## Running Tests + +To run the tests, use the following command: + +```sh +python -m unittest +``` + +This command will automatically discover and run all the test cases in this directory. + +## Directory Structure + +The tests are organized as follows: + +```md +solutions/ + tests/ + __init__.py + test_example.py +``` + +- `__init__.py`: This file makes the directory a Python package. +- `test_example.py`: This file contains example test cases. + +## Writing Tests + +To add new tests, create a new file in the `tests` directory +and define your test cases using the `unittest` framework. + +Here is an example of a simple test case: + +```python +import unittest + +class TestExample(unittest.TestCase): + def test_addition(self): + self.assertEqual(1 + 1, 2) + +``` + +## Test Coverage + +Ensure that your tests cover all the critical parts of your codebase. +Aim for high test coverage to catch potential issues early. + +## Contributing + +If you would like to contribute to the tests, please follow these guidelines: + +1. Write clear and concise test cases. +2. Ensure that your tests pass before submitting a pull request. +3. Follow the existing code style and conventions. + +Let's maintain a high-quality codebase! 👩‍💻✨🚀 diff --git a/solutions/tests/__init__.py b/solutions/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/solutions/tests/test_example.py b/solutions/tests/test_example.py new file mode 100644 index 000000000..5e6cd7a00 --- /dev/null +++ b/solutions/tests/test_example.py @@ -0,0 +1,11 @@ +"""Test example module.""" + +import unittest + + +class TestExample(unittest.TestCase): + """Test example class.""" + + def test_addition(self): + """Test addition method.""" + self.assertEqual(1 + 1, 2)