Python script used for testing my_datetime, conv_num, and conv_endian.
This project implements three core Python functions manually (without using helper libraries for parsing/date conversion):
conv_num(num_str): Converts a numeric string tointorfloat(supports optional negative sign and0xhex).my_datetime(num_sec): Converts seconds since Unix epoch toMM-DD-YYYY.conv_endian(num, endian='big'): Converts an integer to spaced hexadecimal bytes in big- or little-endian form.
task.py— Function implementationstests.py— Unit tests using Pythonunittest
- Python 3.x
From the project root:
python -m unittest -v