Package: unittest-gpt
unittest-gpt📍 Test smarter, not harder with unittest-gpt: GPT-powered auto unit tests generator!⚙️ Developed with the software and tools below:⚙️ Powered by OpenAI's GPT language model APIs and the software below:🦜️🔗📚 Table of Contents📚 Table of Contents📍 Overview💫 Features📂 Project Structure🧩 Modules🚀 Getting Started🗺 Roadmap🤝 Contributing📄 License👏 Acknowledgments📍 Overviewunittest-gpt is a powerful, user-friendly tool that automatically generates unit test files for your python repositories using OpenAI's language model APIs. By simply providing the file or a directory, unittest-gpt will automatically generate unit test for your python source code.🚀 Getting Started✅ PrerequisitesBefore you begin, ensure that you have the following prerequisites installed:📌  OPENAI - API KEY📌  Python 3.11🔐 OpenAI API SetupTo use README-AI, you will need an API key for OpenAI. Follow the steps below to create an API key:User Guide - OpenAI APIGo to theOpenAI website.Click the "Sign up for free" button.Fill out the registration form with your information and agree to the terms of service.Once logged in, click on the "API" tab.Follow the instructions to create a new API key.Copy the API key and keep it in a secure place.🖥 InstallationClone the unittest-gpt repository:gitclone../unittest-gptChange to the project directory:cdunittest-gptSetup up a venv (the least resistance way to get started quickly)if you don't have virtualenv install run the first commandpipinstallvirtualenvvirtualenvvenvsourcevenv/bin/activateInstall the dependencies:pipinstall-rrequirements.txt🤖 Using unittest-gpt as clipythonunit_test_agent.py-f<file_name>
pythonunit_test_agent.py-dir<dir_name>#examplepythonunit_test_agent.py-ftest.py
pythonunit_test_agent.py-dirsrc🤖 Using unittest-gpt in your projectunit_test_agent=UnitTestAgent()# Call the method with the file parameterunit_test_agent.generate_testcases(file="<file_name>")# Call the method with the directory parameterunit_test_agent.generate_testcases(path="<directory>")🧪 Running TestsRun below command in the root directorypytest🤝 ContributingContributions are always welcome! Please follow these steps:Fork the project repository. This creates a copy of the project on your account that you can modify without affecting the original project.Clone the forked repository to your local machine using a Git client like Git or GitHub Desktop.Create a new branch with a descriptive name (e.g.,new-feature-branchorbugfix-issue-123).gitcheckout-bnew-feature-branchMake changes to the project's codebase.Commit your changes to your local branch with a clear commit message that explains the changes you've made.gitcommit-m'Implemented new feature.'Push your changes to your forked repository on GitHub using the following commandgitpushoriginnew-feature-branchCreate a pull request to the original repository.
Open a new pull request to the original project repository. In the pull request, describe the changes you've made and why they're necessary.
The project maintainers will review your changes and provide feedback or merge them into the main branch.📄 LicenseThis project is licensed under theMIT LicenseLicense. See theLICENSEfile for additional info.👏 Acknowledgmentshwchase17/langchainwouldn't have built without langchain.gkamradt/langchain-tutorialshis videos are inspiring and open your imagination to build cool things.eli64s/README-AIthanks for helping me set up a quick readme.md file. Will use it for all projects going forward.