Add pytest for license scriptlet
parent
38a8c9d29b
commit
83310747f5
|
@ -3,3 +3,4 @@ tqdm
|
||||||
pandas
|
pandas
|
||||||
pathlib
|
pathlib
|
||||||
termcolor
|
termcolor
|
||||||
|
pytest
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_records():
|
||||||
|
df = pd.DataFrame({"a": [1, 2, 3]})
|
||||||
|
|
||||||
|
assert get_records(df, "-1-2").equals(pd.DataFrame({"a": [1, 2]}))
|
||||||
|
assert get_records(df, "1").equals(pd.DataFrame({"a": [1]}))
|
||||||
|
|
||||||
|
|
||||||
|
def test_print_records():
|
||||||
|
df = pd.DataFrame({"a": [1, 2]})
|
||||||
|
|
||||||
|
# You can mock print function and check that it was called with correct arguments
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def test_print_unique_licenses():
|
||||||
|
df = pd.DataFrame({"license": ["MIT", "GPL", "Apache"]})
|
||||||
|
|
||||||
|
# Same as above, you can mock print function and check that it was called with sorted licenses
|
||||||
|
pass
|
Loading…
Reference in New Issue