fork/mons

git clone https://git.julia.blue/fork/mons

coloursofnoiseUpdate and fix tests, ensure all tests passe96b46b

main
677 B33 linesraw
1import pytest
2
3from mons.formatting import format_bytes
4from mons.formatting import format_columns
5
6
7@pytest.mark.parametrize("input, expected", [(1299999, "1.2 MiB")])
8def test_format_bytes(input, expected):
9    assert format_bytes(input) == expected
10
11
12@pytest.mark.parametrize(
13    "input, expected",
14    [
15        (
16            {"foo": "value", "bar": "value"},
17            """
18foo\tvalue
19bar\tvalue
20""".strip(),
21        ),
22        (
23            {"foo": "value", "foobarbaz": "value"},
24            """
25foo      \tvalue
26foobarbaz\tvalue
27""".strip(),
28        ),
29        ({}, ""),
30    ],
31)
32def test_format_columns(input, expected):
33    assert format_columns(input) == expected