{"id":39560279,"url":"https://github.com/anuragpatil94/codetest","last_synced_at":"2026-01-18T07:05:59.136Z","repository":{"id":62563345,"uuid":"321991962","full_name":"anuragpatil94/codetest","owner":"anuragpatil94","description":"A library for testing coding problems easily","archived":false,"fork":false,"pushed_at":"2021-09-26T21:47:50.000Z","size":81,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-05T22:24:39.509Z","etag":null,"topics":["testing","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anuragpatil94.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-16T13:32:36.000Z","updated_at":"2023-03-09T01:51:44.000Z","dependencies_parsed_at":"2022-11-03T15:45:22.578Z","dependency_job_id":null,"html_url":"https://github.com/anuragpatil94/codetest","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/anuragpatil94/codetest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuragpatil94%2Fcodetest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuragpatil94%2Fcodetest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuragpatil94%2Fcodetest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuragpatil94%2Fcodetest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anuragpatil94","download_url":"https://codeload.github.com/anuragpatil94/codetest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anuragpatil94%2Fcodetest/sbom","scorecard":{"id":200128,"data":{"date":"2025-08-11","repo":{"name":"github.com/anuragpatil94/codetest","commit":"03768957f98fb9fb4bc5a19a3c0c875e3c33e0f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/black.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/black.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/anuragpatil94/codetest/black.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/black.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/anuragpatil94/codetest/black.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/black.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/anuragpatil94/codetest/black.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/anuragpatil94/codetest/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/anuragpatil94/codetest/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T22:40:04.220Z","repository_id":62563345,"created_at":"2025-08-16T22:40:04.220Z","updated_at":"2025-08-16T22:40:04.220Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28532630,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["testing","testing-tools"],"created_at":"2026-01-18T07:05:53.751Z","updated_at":"2026-01-18T07:05:59.131Z","avatar_url":"https://github.com/anuragpatil94.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# codetest\n\nA simple python library which makes it easier to test code after solving a coding problem.\n\n## How to Install\n\n`codetest` can be installed using `pip install codetest`.\n\n- required\n  - Python 3.6.0+\n\n\u003e `pip install codetest`\n\n## How to Use\n\nTo run a test, you need to pass an array of tests and the class in which the function is written\n\n```python\nfrom codetest import CodeTest\n\nclass AnyName:\n    def AnyNameFn(self,...AnyNumberOfInputs):\n        return result\n\ntests = [\n    {},\n    ...\n]\n\n# Call to the Test Library\nCodeTest(tests,AnyName)\n\n```\n\n### How to write a testcase?\n\n```python\n#index.py\nfrom codetest import CodeTest\nclass Problem:\n    def sumOfTwoNumbers(self, a=2,b=2):\n        return a + b\n    def main(self, a=2,b=2):\n        return a - b\n\ntests = [\n    #Test 0\n    {\n        \"function\" : \"sumOfTwoNumbers\",\n        \"params\" : {\n            \"input\":[\n                {\"value\":5},\n                {\"value\":4},\n            ],\n            \"output\":[{\"value\":8}]\n        }\n    },\n    #Test 1\n    {\n        \"function\" : \"sumOfTwoNumbers\",\n        \"params\" : {\n            #input not passed hence the function either takes default values or doesn't expect any inputs\n            \"output\":[{\"value\":8}]\n        }\n    },\n    #Test 2\n    {\n        # if function is not passed then `main` is executed\n        \"params\" : {\n            #input not passed hence the function either takes default values or doesn't expect any inputs\n            \"output\":[{\"value\":8}]\n        }\n    },\n]\n\nCodeTest(tests,Problem)\n```\n\n- This will result in following output\n\n```text\n--------------------------[TEST 0]--------------------------\nExpected Output: 8\nComputed Output: 9\n                                             [Time: 0.001ms]\n------------------------------------------------------------\n--------------------------[TEST 1]--------------------------\nExpected Output: 8\nComputed Output: 4\n                                             [Time: 0.001ms]\n------------------------------------------------------------\n--------------------------[TEST 2]--------------------------\nExpected Output: 8\nComputed Output: 0\n                                             [Time: 0.001ms]\n------------------------------------------------------------\n```\n\n## Tests\n\n### Testcase Structure\n\n`? - Optional`\n\n```python\n    tests = [\n        {\n            function?: \"\" // default \"main\"\n            params?: {\n                input?:[],\n                output?:[]\n            }\n        }\n    ]\n```\n\n- If `function` is not provided, the default function would be `main`\n- The order in which the `input` objects are added would be same as the params passed to the `function`.\n- if `input` is not passed, then it is considered same as no inputs passed to the function\n- if `output` is not passed, then the test doesn't expect any output to be returned from the function.\n- if `params` is not passed, then the function is executed as-is with no input and output\n\n### Input/Output Structure\n\n`? - Optional`\n\n```python\n    {\n        value: any,\n        type?: any,\n    }\n```\n\n#### Supported Types\n\n1. `int`\n2. `float`\n3. `list`\n4. `tuple`\n5. `dict`\n6. `set`\n7. `bool`\n8. `linkedlist`\n9. `binarytree`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuragpatil94%2Fcodetest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanuragpatil94%2Fcodetest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanuragpatil94%2Fcodetest/lists"}