From 9d9b24e415df8bd6662595169f330038ee45d569 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 11:41:04 +1000 Subject: [PATCH 01/11] General: Add initial test. --- pywal/util.py | 4 +++- tests/__init__.py | 4 ++++ tests/test_file | 16 ++++++++++++++ tests/test_util.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 1 deletion(-) create mode 100755 tests/__init__.py create mode 100644 tests/test_file create mode 100755 tests/test_util.py diff --git a/pywal/util.py b/pywal/util.py index bc385d91..67baa6ac 100755 --- a/pywal/util.py +++ b/pywal/util.py @@ -8,7 +8,9 @@ def read_file(input_file): """Read colors from a file.""" - return open(input_file).read().splitlines() + with open(input_file) as file: + colors = file.read().splitlines() + return colors def save_file(colors, export_file): diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100755 index 00000000..af433d72 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,4 @@ +""" +wal - Generate and change colorschemes on the fly. +Created by Dylan Araps. +""" diff --git a/tests/test_file b/tests/test_file new file mode 100644 index 00000000..30eeeaa2 --- /dev/null +++ b/tests/test_file @@ -0,0 +1,16 @@ +#363442 +#99A3B1 +#C5BDB6 +#98AEC2 +#A8B9C6 +#96C4CF +#B7C5CC +#C9CFD0 +#999999 +#99A3B1 +#C5BDB6 +#98AEC2 +#A8B9C6 +#96C4CF +#B7C5CC +#C9CFD0 diff --git a/tests/test_util.py b/tests/test_util.py new file mode 100755 index 00000000..3aebc785 --- /dev/null +++ b/tests/test_util.py @@ -0,0 +1,54 @@ +"""Test util functions.""" +import unittest +import pathlib +from pywal import util + + +class TestUtil(unittest.TestCase): + """Test the util functions.""" + + def test_read_file_start(self): + """Test read_file().""" + result = util.read_file("tests/test_file") + self.assertEqual(result[0], "#363442") + + def test_read_file_end(self): + """Test read_file().""" + result = util.read_file("tests/test_file") + self.assertEqual(result[15], "#C9CFD0") + + def test_save_file(self): + """Test save_file().""" + tmp_file = pathlib.Path("/tmp/test_file") + util.save_file("Hello, world", tmp_file) + result = tmp_file.is_file() + self.assertTrue(result) + + def test_create_dir(self): + """Test create_dir().""" + tmp_dir = pathlib.Path("/tmp/test_dir") + util.create_dir(tmp_dir) + result = tmp_dir.is_dir() + self.assertTrue(result) + + def test_hex_to_rgb_black(self): + """Test hex_to_rgb() on #000000.""" + result = util.hex_to_rgb("#000000") + self.assertEqual(result, "0,0,0") + + def test_hex_to_rgb_white(self): + """Test hex_to_rgb() on #FFFFFF.""" + result = util.hex_to_rgb("#FFFFFF") + self.assertEqual(result, "255,255,255") + + def test_hex_to_rgb_rand(self): + """Test hex_to_rgb() on #98AEC2.""" + result = util.hex_to_rgb("#98AEC2") + self.assertEqual(result, "152,174,194") + + # Figure out how to test this. + # def test_disown(self): + + +if __name__ == "__main__": + unittest.main() From bae528e85629562c3382ed981b3357193cde142b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 11:53:40 +1000 Subject: [PATCH 02/11] tests: Integrate tests with setup.pu --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d6a80170..d0729b6e 100644 --- a/setup.py +++ b/setup.py @@ -35,5 +35,6 @@ entry_points={ "console_scripts": ["wal=pywal.__main__:main"] }, - python_requires=">=3.6" + python_requires=">=3.6", + test_suite="tests", ) From ce2d85d5d6ef321b5950d9728ee7204e5724a945 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 11:55:08 +1000 Subject: [PATCH 03/11] tests: Integrate tests with travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 46e5aaa8..464bdf86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,4 @@ install: script: - flake8 pywal setup.py - pylint --ignore-imports=yes pywal setup.py + - python setup.py test From 10c7099a27542d58a66e4fb8d740ec62db2904bf Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:02:42 +1000 Subject: [PATCH 04/11] tests: Fix comments --- setup.py | 2 +- tests/test_export_colors.py | 21 +++++++++++++++++++++ tests/test_util.py | 14 +++++++------- 3 files changed, 29 insertions(+), 8 deletions(-) create mode 100755 tests/test_export_colors.py diff --git a/setup.py b/setup.py index d0729b6e..9e22fef3 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,6 @@ entry_points={ "console_scripts": ["wal=pywal.__main__:main"] }, - python_requires=">=3.6", + requires_python=">=3.6", test_suite="tests", ) diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py new file mode 100755 index 00000000..ce6fe1ec --- /dev/null +++ b/tests/test_export_colors.py @@ -0,0 +1,21 @@ +"""Test util functions.""" +import unittest +import pathlib +from pywal import export_colors +from pywal import util + + +class TestExportColors(unittest.TestCase): + """Test the export_colors functions.""" + + def test_save_colors(self): + """> Export colors to a file.""" + tmp_file = pathlib.Path("/tmp/test_file") + colors = util.read_file("tests/test_file") + export_colors.save_colors(colors, tmp_file, "plain colors") + result = tmp_file.is_file() + self.assertTrue(result) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_util.py b/tests/test_util.py index 3aebc785..0d72f013 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -8,41 +8,41 @@ class TestUtil(unittest.TestCase): """Test the util functions.""" def test_read_file_start(self): - """Test read_file().""" + """> Read colors from a file.""" result = util.read_file("tests/test_file") self.assertEqual(result[0], "#363442") def test_read_file_end(self): - """Test read_file().""" + """> Read colors from a file.""" result = util.read_file("tests/test_file") self.assertEqual(result[15], "#C9CFD0") def test_save_file(self): - """Test save_file().""" + """> Save colors to a file.""" tmp_file = pathlib.Path("/tmp/test_file") util.save_file("Hello, world", tmp_file) result = tmp_file.is_file() self.assertTrue(result) def test_create_dir(self): - """Test create_dir().""" + """> Create a directoru.""" tmp_dir = pathlib.Path("/tmp/test_dir") util.create_dir(tmp_dir) result = tmp_dir.is_dir() self.assertTrue(result) def test_hex_to_rgb_black(self): - """Test hex_to_rgb() on #000000.""" + """> Convert #000000 to RGB.""" result = util.hex_to_rgb("#000000") self.assertEqual(result, "0,0,0") def test_hex_to_rgb_white(self): - """Test hex_to_rgb() on #FFFFFF.""" + """> Convert #FFFFFF to RGB.""" result = util.hex_to_rgb("#FFFFFF") self.assertEqual(result, "255,255,255") def test_hex_to_rgb_rand(self): - """Test hex_to_rgb() on #98AEC2.""" + """> Convert #98AEC2 to RGB.""" result = util.hex_to_rgb("#98AEC2") self.assertEqual(result, "152,174,194") From 081bb9066bf754aee23489a76f0d5e63bcb4935b Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:14:47 +1000 Subject: [PATCH 05/11] tests: Added format_colors test. --- tests/test_format_colors.py | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 tests/test_format_colors.py diff --git a/tests/test_format_colors.py b/tests/test_format_colors.py new file mode 100755 index 00000000..fab7181a --- /dev/null +++ b/tests/test_format_colors.py @@ -0,0 +1,46 @@ +"""Test format functions.""" +import unittest +from pywal import format_color +from pywal import util + + +# Import colors. +COLORS = util.read_file("tests/test_file") + + +class TestExportColors(unittest.TestCase): + """Test the format_colors functions.""" + + def test_plain(self): + """> Convert colors to plain.""" + result = format_color.plain(COLORS) + self.assertEqual(result[0], "#363442\n") + + def test_shell(self): + """> Convert colors to shell variables.""" + result = format_color.shell(COLORS) + self.assertEqual(result[0], "color0='#363442'\n") + + def test_css(self): + """> Convert colors to css variables.""" + result = format_color.css(COLORS) + self.assertEqual(result[1], "\t--color0: #363442;\n") + + def test_scss(self): + """> Convert colors to scss variables.""" + result = format_color.scss(COLORS) + self.assertEqual(result[0], "$color0: #363442;\n") + + def test_putty(self): + """> Convert colors to putty theme.""" + result = format_color.putty(COLORS) + self.assertEqual(result[2], "\"colour0\"=\"54,52,66\"\n") + + def test_xrdb(self): + """> Convert colors to putty theme.""" + result = format_color.xrdb(COLORS) + self.assertEqual(result[6], "*.color0: #363442\n*color0: #363442\n") + + +if __name__ == "__main__": + unittest.main() From 790ab71c50ad4d7e695d4e868933363c4be090fa Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:24:27 +1000 Subject: [PATCH 06/11] tests: Added set_colors tests. --- setup.py | 2 +- tests/test_export_colors.py | 5 +++++ tests/test_format_colors.py | 3 ++- tests/test_set_colors.py | 32 ++++++++++++++++++++++++++++++++ tests/test_util.py | 1 + 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100755 tests/test_set_colors.py diff --git a/setup.py b/setup.py index 9e22fef3..d0729b6e 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,6 @@ entry_points={ "console_scripts": ["wal=pywal.__main__:main"] }, - requires_python=">=3.6", + python_requires=">=3.6", test_suite="tests", ) diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py index ce6fe1ec..5680dfcb 100755 --- a/tests/test_export_colors.py +++ b/tests/test_export_colors.py @@ -1,10 +1,15 @@ """Test util functions.""" import unittest import pathlib + from pywal import export_colors from pywal import util +# Import colors. +COLORS = util.read_file("tests/test_file") + + class TestExportColors(unittest.TestCase): """Test the export_colors functions.""" diff --git a/tests/test_format_colors.py b/tests/test_format_colors.py index fab7181a..ecee3364 100755 --- a/tests/test_format_colors.py +++ b/tests/test_format_colors.py @@ -1,5 +1,6 @@ """Test format functions.""" import unittest + from pywal import format_color from pywal import util @@ -8,7 +9,7 @@ COLORS = util.read_file("tests/test_file") -class TestExportColors(unittest.TestCase): +class TestFormatColors(unittest.TestCase): """Test the format_colors functions.""" def test_plain(self): diff --git a/tests/test_set_colors.py b/tests/test_set_colors.py new file mode 100755 index 00000000..5ff6b5ce --- /dev/null +++ b/tests/test_set_colors.py @@ -0,0 +1,32 @@ +"""Test set functions.""" +import unittest + +from pywal import set_colors +from pywal import util + + +# Import colors. +COLORS = util.read_file("tests/test_file") + + +class TestSetColors(unittest.TestCase): + """Test the format_colors functions.""" + + def test_set_special(self): + """> Create special escape sequence.""" + result = set_colors.set_special(11, COLORS[0]) + self.assertEqual(result, "\x1b]11;#363442\x07") + + def test_set_color(self): + """> Create color escape sequence.""" + result = set_colors.set_color(11, COLORS[0]) + self.assertEqual(result, "\033]4;11;#363442\007") + + def test_set_grey(self): + """> Create special escape sequence.""" + result = set_colors.set_grey(COLORS) + self.assertEqual(result, "#999999") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_util.py b/tests/test_util.py index 0d72f013..6aeef9ba 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -1,6 +1,7 @@ """Test util functions.""" import unittest import pathlib + from pywal import util From 9e2fb01222ddc06cc77675e8821eefe6c0101377 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:30:31 +1000 Subject: [PATCH 07/11] tests: Added gen_colors test. --- tests/test.jpg | 0 tests/test_gen_colors.py | 27 +++++++++++++++++++++++++++ tests/test_set_colors.py | 2 +- 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/test.jpg create mode 100755 tests/test_gen_colors.py diff --git a/tests/test.jpg b/tests/test.jpg new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_gen_colors.py b/tests/test_gen_colors.py new file mode 100755 index 00000000..e9fa5e2d --- /dev/null +++ b/tests/test_gen_colors.py @@ -0,0 +1,27 @@ +"""Test gen functions.""" +import unittest + +from pywal import gen_colors +from pywal import util + + +# Import colors. +COLORS = util.read_file("tests/test_file") + + +class TestGenColors(unittest.TestCase): + """Test the gen_colors functions.""" + + def test_get_img(self): + """> Validate image file.""" + result = gen_colors.get_image("tests/test.jpg") + self.assertEqual(result, "tests/test.jpg") + + def test_get_img_dir(self): + """> Validate image directory.""" + result = gen_colors.get_image("tests") + self.assertEqual(result, "tests/test.jpg") + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_set_colors.py b/tests/test_set_colors.py index 5ff6b5ce..3d3d8003 100755 --- a/tests/test_set_colors.py +++ b/tests/test_set_colors.py @@ -10,7 +10,7 @@ class TestSetColors(unittest.TestCase): - """Test the format_colors functions.""" + """Test the set_colors functions.""" def test_set_special(self): """> Create special escape sequence.""" From dbba94976cee6ab155ab6fc1bcf3344c6228c516 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:34:34 +1000 Subject: [PATCH 08/11] tests: Move test files to other directory. --- .travis.yml | 4 ++-- tests/test_export_colors.py | 4 ++-- tests/{ => test_files}/test.jpg | 0 tests/{ => test_files}/test_file | 0 tests/test_format_colors.py | 2 +- tests/test_gen_colors.py | 13 ++++--------- tests/test_set_colors.py | 2 +- tests/test_util.py | 4 ++-- 8 files changed, 12 insertions(+), 17 deletions(-) rename tests/{ => test_files}/test.jpg (100%) rename tests/{ => test_files}/test_file (100%) diff --git a/.travis.yml b/.travis.yml index 464bdf86..f3f35ac2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,6 @@ install: - pip install flake8 pylint script: - - flake8 pywal setup.py - - pylint --ignore-imports=yes pywal setup.py + - flake8 pywal tests setup.py + - pylint --ignore-imports=yes pywal tests setup.py - python setup.py test diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py index 5680dfcb..09265c62 100755 --- a/tests/test_export_colors.py +++ b/tests/test_export_colors.py @@ -7,7 +7,7 @@ # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestExportColors(unittest.TestCase): @@ -16,7 +16,7 @@ class TestExportColors(unittest.TestCase): def test_save_colors(self): """> Export colors to a file.""" tmp_file = pathlib.Path("/tmp/test_file") - colors = util.read_file("tests/test_file") + colors = util.read_file("tests/test_files/test_file") export_colors.save_colors(colors, tmp_file, "plain colors") result = tmp_file.is_file() self.assertTrue(result) diff --git a/tests/test.jpg b/tests/test_files/test.jpg similarity index 100% rename from tests/test.jpg rename to tests/test_files/test.jpg diff --git a/tests/test_file b/tests/test_files/test_file similarity index 100% rename from tests/test_file rename to tests/test_files/test_file diff --git a/tests/test_format_colors.py b/tests/test_format_colors.py index ecee3364..63c1ce2d 100755 --- a/tests/test_format_colors.py +++ b/tests/test_format_colors.py @@ -6,7 +6,7 @@ # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestFormatColors(unittest.TestCase): diff --git a/tests/test_gen_colors.py b/tests/test_gen_colors.py index e9fa5e2d..8bab35a6 100755 --- a/tests/test_gen_colors.py +++ b/tests/test_gen_colors.py @@ -2,11 +2,6 @@ import unittest from pywal import gen_colors -from pywal import util - - -# Import colors. -COLORS = util.read_file("tests/test_file") class TestGenColors(unittest.TestCase): @@ -14,13 +9,13 @@ class TestGenColors(unittest.TestCase): def test_get_img(self): """> Validate image file.""" - result = gen_colors.get_image("tests/test.jpg") - self.assertEqual(result, "tests/test.jpg") + result = gen_colors.get_image("tests/test_files/test.jpg") + self.assertEqual(result, "tests/test_files/test.jpg") def test_get_img_dir(self): """> Validate image directory.""" - result = gen_colors.get_image("tests") - self.assertEqual(result, "tests/test.jpg") + result = gen_colors.get_image("tests/test_files") + self.assertEqual(result, "tests/test_files/test.jpg") if __name__ == "__main__": diff --git a/tests/test_set_colors.py b/tests/test_set_colors.py index 3d3d8003..43c6aed1 100755 --- a/tests/test_set_colors.py +++ b/tests/test_set_colors.py @@ -6,7 +6,7 @@ # Import colors. -COLORS = util.read_file("tests/test_file") +COLORS = util.read_file("tests/test_files/test_file") class TestSetColors(unittest.TestCase): diff --git a/tests/test_util.py b/tests/test_util.py index 6aeef9ba..b1a396b7 100755 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -10,12 +10,12 @@ class TestUtil(unittest.TestCase): def test_read_file_start(self): """> Read colors from a file.""" - result = util.read_file("tests/test_file") + result = util.read_file("tests/test_files/test_file") self.assertEqual(result[0], "#363442") def test_read_file_end(self): """> Read colors from a file.""" - result = util.read_file("tests/test_file") + result = util.read_file("tests/test_files/test_file") self.assertEqual(result[15], "#C9CFD0") def test_save_file(self): From 2cee85a15ed50a7ef3fc94b4fb47ba4d5cb44a51 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:43:14 +1000 Subject: [PATCH 09/11] tests: Add a real image file. --- tests/test_files/test.jpg | Bin 0 -> 8074 bytes tests/test_gen_colors.py | 5 +++++ 2 files changed, 5 insertions(+) diff --git a/tests/test_files/test.jpg b/tests/test_files/test.jpg index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b613ed033907dd65086f2d56cedd039f307b99e3 100644 GIT binary patch literal 8074 zcmbVw2RK|^*Y=sJ%wWb0(Tx(lNAJCh5(Lr4=)DU;bb>^Q5+p>4=s}{UDhWY|UL#6E zkO&b$2;X?}zImSazpn55|NmPv*SYSq_S)y{bFXsNJ||Nr3jj)2Q%4g3fk1#Z@dunN zAuV*&)a;B*3^jH1HHZTMfYjD^^Y#Iw0Km&T(BDK$6=z{-g(DdRzyKKl2Sfn?PYCce zxS(kY5Jg8r4HrN(I>mp>j|qTyB>)%|)HcH5{?`9LAvD3)KM(*wMnvm#j!pptB90?s z&yYahQ~eeZV;wwBF&KJ^{fP@CV!Bi8@*4~MW%C;=pJGQZZ%3ld>6(2Vy&O+*HxVZV z2RRWjM4yNgg58`#hMIX#2C+=zIeh_PNy_y7QaB2V>!P6SsX79nD!zp05D5z7Mr zDbnR1*x?^I(CIR9odBTb;~VPl=HeQN<00_kL}g^8aoSEHo=$;*f<}0P2j1Tir{?43 zi}wx%fZxx2It!pa8Hje^Z{6Q> z|JM1G0D$x^k(>0tbq;v|&=L;-bTfbJIPU@gRU7~`5B=kLXiwwCH89XuR#-SBBt*!~ zi6C@J=pXsN8vL>R@4-LrCv7EW9slD1P9vUz1KeD2 zr)o75Qyd}4Kll_AbK>*>1IPg?01MCqEC2_<0|)|QfD|AHC<7XRE?@|l0+xU+Kmc3; zFTfuN0m6Z3AOT1L(t&IsA1DIKfJ&eaXarh-CqM`A3g`#k0^`6eumF4nHh?YQ2XII% zWF#O85C%jKVg;QA@q@%b(jY~U21p-d0E3g$^_+uib0j222dNQ z1N0g+44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?~AaF+TR-pEEB|;3N^L#+(tpkyo^}t?@jK= zr}9Vt2+tu51CWxH+JZvimU%iqnDTmg;Wdh~j$_=I`?En?%4eh%G=dvu>n%&(#a*OQ z=5bMBKhob9%_;N4B{v2~cPBtbjN}n4p`pk1*Zbo(_7<~BGXmd9e2~@mco{yl2U`Tj zNHPPC>>-LpnOesv{QwF#I`olskX1;Cf{{rRrn_~a~ literal 0 HcmV?d00001 diff --git a/tests/test_gen_colors.py b/tests/test_gen_colors.py index 8bab35a6..18ba821a 100755 --- a/tests/test_gen_colors.py +++ b/tests/test_gen_colors.py @@ -17,6 +17,11 @@ def test_get_img_dir(self): result = gen_colors.get_image("tests/test_files") self.assertEqual(result, "tests/test_files/test.jpg") + def test_gen_colors(self): + """> Generate a colorscheme.""" + result = gen_colors.gen_colors("tests/test_files/test.jpg") + self.assertEqual(result[0], "#0F191A") + if __name__ == "__main__": unittest.main() From 79346ca941ae019acabea2177a4c045565ac134a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:44:29 +1000 Subject: [PATCH 10/11] travis: Install imagemagick. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index f3f35ac2..f924d60a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,10 @@ language: python python: - "3.6" +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y imagemagick + install: - pip install flake8 pylint From 7c3676c809a06aafb4f6f3b8cdc289c946be7695 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 27 Jun 2017 17:46:55 +1000 Subject: [PATCH 11/11] tests: Fix comment. --- tests/test_export_colors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_export_colors.py b/tests/test_export_colors.py index 09265c62..5ca04d9a 100755 --- a/tests/test_export_colors.py +++ b/tests/test_export_colors.py @@ -1,4 +1,4 @@ -"""Test util functions.""" +"""Test export functions.""" import unittest import pathlib