{"id":26704917,"url":"https://github.com/hbloodprince7/aitestcasegenerator","last_synced_at":"2026-05-06T18:32:38.698Z","repository":{"id":284485917,"uuid":"951923923","full_name":"hbloodprince7/AITestCaseGenerator","owner":"hbloodprince7","description":"A simple Streamlit webapp to generate Unit tests for User Code using Google Gemini API","archived":false,"fork":false,"pushed_at":"2025-03-26T05:39:11.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T06:27:19.317Z","etag":null,"topics":["google-gemini-ai","langchain","python","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hbloodprince7.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-20T13:06:20.000Z","updated_at":"2025-03-26T05:42:13.000Z","dependencies_parsed_at":"2025-03-26T06:37:57.180Z","dependency_job_id":null,"html_url":"https://github.com/hbloodprince7/AITestCaseGenerator","commit_stats":null,"previous_names":["hbloodprince7/aitestcasegenerator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hbloodprince7/AITestCaseGenerator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbloodprince7%2FAITestCaseGenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbloodprince7%2FAITestCaseGenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbloodprince7%2FAITestCaseGenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbloodprince7%2FAITestCaseGenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hbloodprince7","download_url":"https://codeload.github.com/hbloodprince7/AITestCaseGenerator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hbloodprince7%2FAITestCaseGenerator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231163,"owners_count":25245675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-gemini-ai","langchain","python","streamlit"],"created_at":"2025-03-27T05:18:35.448Z","updated_at":"2026-05-06T18:32:38.658Z","avatar_url":"https://github.com/hbloodprince7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gemini Unit Test Generator\n\nThis Streamlit application allows you to generate unit tests for your code using the Google Gemini model. You can either upload a code file (Python, C#, or Java) or enter code directly into the application.\n\n## Features\n\n* **Code Input:** Upload code files or manually enter code snippets.\n* **Unit Test Generation:** Generates 5 unit tests for your provided code using Google's Gemini model.\n* **Language Detection:** Attempts to detect the programming language of your code to generate tests in the correct language.\n* **File Download:** Downloads the generated unit tests as a file (e.g., `unit_tests.py`, `unit_tests.java`, `unit_tests.cs`).\n* **Streamlit Interface:** User-friendly web interface for easy interaction.\n\n## Prerequisites\n\n* Python 3.6+\n* Google Gemini API Key\n* Required Python packages (install using ``)\n\n## Installation\n\n1.  **Clone the repository (or download the Python script).**\n2.  **Install the required Python packages:**\n\n    ```bash\n    pip -r requirements.txt\n    ```\n\n3.  **Set up your Google Gemini API Key:**\n    * Create a `.env` file in the same directory as your Python script.\n    * Add your API key to the `.env` file in the following format:\n\n        ```\n        GOOGLE_API_KEY=YOUR_ACTUAL_API_KEY\n        ```\n\n    * Replace `YOUR_ACTUAL_API_KEY` with your actual API key.\n\n## Usage\n\n1.  **Run the Streamlit application:**\n\n    ```bash\n    streamlit run your_script_name.py\n    ```\n\n    (Replace `your_script_name.py` with the name of your Python script.)\n\n2.  **Open the application in your web browser:**\n    * A local URL will be displayed in your terminal. Open this URL in your browser.\n\n3.  **Enter your code:**\n    * You can either upload a code file or enter code directly into the text area.\n\n4.  **Click the \"Generate Unit Tests\" button:**\n    * The application will send your code to the Gemini model and generate unit tests.\n\n5.  **Download the unit tests:**\n    * A download button will appear, allowing you to download the generated unit tests as a file.\n\n## Example\n\n1.  Upload a python file called `add_numbers.py` or paste the following code into the text area:\n\n    ```python\n    def add_numbers(a, b):\n        return a + b\n    ```\n\n2.  Click the \"Generate Unit Tests\" button.\n\n3.  Download the generated `unit_tests.py` file.\n\n## Notes\n\n* The language detection is basic. Please verify that the tests are generated in the correct language.\n* The quality of the generated tests depends on the complexity and clarity of your code.\n* Ensure that your Google Gemini API key is properly set up in the `.env` file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbloodprince7%2Faitestcasegenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhbloodprince7%2Faitestcasegenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhbloodprince7%2Faitestcasegenerator/lists"}