CS2613/labs/L14/test_client.py

19 lines
335 B
Python
Raw Normal View History

import pytest
from client import approximate_size
def test_1kb():
assert approximate_size(1_000) == "1.0 KB"
def test_100mb():
assert approximate_size(100_000_000) == "100.0 MB"
def test_1gb():
assert approximate_size(1_000_000_000) == "1.0 GB"
def test_docstring():
assert approximate_size.__doc__ is not None