A testing library for coding problems
Project description
codetest
A simple python library which makes it easier to test code after solving a coding problem.
How to Install
pip install codetest
How to Use
How to write a testcase?
#index.py
from codetest import CodeTest
class Problem:
def sumOfTwoNumbers(self, a,b):
return a + b
tests = [{
"function" : "sumOfTwoNumbers",
"params" : {
"input":[
{"value":5},
{"value":4},
],
"output":[{"value":8}]
}
}]
CodeTest(tests,Problem)
- This will result in following output
--------------------------[TEST 0]--------------------------
Expected Output: 8
Actual Output: 9
[Time: 0.001ms]
------------------------------------------------------------
Tests
Testcase Structure
? - Optional
tests = [
{
function?: "" // default "main"
params: {
input:[],
output:[]
}
}
]
- If
functionis not provided, the default function would bemain - The order in which the
inputObjects are supposed to be added would be same as the params passed in thefunction.
Input/Output Structure
? - Optional
{
value: any,
type?: any,
}
Supported Types
intfloatlisttupledictsetboollinkedlistbinarytree
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
codetest-1.0.1.tar.gz
(8.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codetest-1.0.1.tar.gz.
File metadata
- Download URL: codetest-1.0.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac61d41ef1c0e92108f2d331079cee12fdbb061073aff18a8caae193976ad1e7
|
|
| MD5 |
e19a6c53dd68f74e9410a8be339b8188
|
|
| BLAKE2b-256 |
76af228af6f196d4955031c910b724c1f3e937592ee7d8c37512c7b773a4d4b6
|
File details
Details for the file codetest-1.0.1-py3-none-any.whl.
File metadata
- Download URL: codetest-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.8.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dcbdd1d4de0a5f5752d40c2c431eaea6f8f1334d65bf0e9af8a8741e5e6d88a
|
|
| MD5 |
2bf46c4a102c9baed4cbe717d8652e5d
|
|
| BLAKE2b-256 |
4add25e29ffda57b71974b3d46e185633d7349795192d3fd7d3d81371f04aaec
|