From 43f221cba707476b1bca763a56dfa20fa0993088 Mon Sep 17 00:00:00 2001 From: Austin Plymill Date: Thu, 26 Mar 2020 13:03:40 -0500 Subject: [PATCH 1/7] adding tests for plotter --- .idea/libraries/R_User_Library.xml | 6 + .idea/misc.xml | 4 + .idea/modules.xml | 8 ++ .idea/workspace.xml | 215 +++++++++++++++++++++++++++++ tests/test_plotter.py | 45 ++++++ 5 files changed, 278 insertions(+) create mode 100644 .idea/libraries/R_User_Library.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/workspace.xml create mode 100644 tests/test_plotter.py diff --git a/.idea/libraries/R_User_Library.xml b/.idea/libraries/R_User_Library.xml new file mode 100644 index 00000000..71f5ff74 --- /dev/null +++ b/.idea/libraries/R_User_Library.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..65531ca9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..6a99e072 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..5349635a --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1585236879632 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 5a8f25c3163e56d3ddd9ef70d7dca94f8e6d5806 Mon Sep 17 00:00:00 2001 From: aplymill7 <47641688+aplymill7@users.noreply.github.com> Date: Thu, 26 Mar 2020 13:08:07 -0500 Subject: [PATCH 5/7] Delete R_User_Library.xml --- .idea/libraries/R_User_Library.xml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .idea/libraries/R_User_Library.xml diff --git a/.idea/libraries/R_User_Library.xml b/.idea/libraries/R_User_Library.xml deleted file mode 100644 index 71f5ff74..00000000 --- a/.idea/libraries/R_User_Library.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 07ec3b13967456013408184463d099fecd025bd5 Mon Sep 17 00:00:00 2001 From: Simon Billinge Date: Sat, 18 Jan 2025 13:52:06 -0500 Subject: [PATCH 6/7] EOF CR in test_plotter.py --- tests/test_plotter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_plotter.py b/tests/test_plotter.py index ae269734..7bd0a15b 100644 --- a/tests/test_plotter.py +++ b/tests/test_plotter.py @@ -42,4 +42,4 @@ def test_plot_updater(): xlabel = line.xaxis.get_label() ylabel = line.yaxis.get_label() assert xlabel == "Voltage (V)" - assert ylabel == "Current (mA)" \ No newline at end of file + assert ylabel == "Current (mA)" From 46733f69fbbe2cab9808d01ee333793ef0ccc7ad Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 18 Jan 2025 18:52:16 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit hooks --- tests/test_plotter.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_plotter.py b/tests/test_plotter.py index 7bd0a15b..f14d42b4 100644 --- a/tests/test_plotter.py +++ b/tests/test_plotter.py @@ -1,19 +1,21 @@ -from pytentiostat.plotter import plot_initializer, plot_updater -import pytentiostat.config_reader as cr import os + import mock +import pytentiostat.config_reader as cr +from pytentiostat.plotter import plot_initializer, plot_updater + THIS_DIR = os.path.dirname(os.path.abspath(__file__)) def test_plot_initializer(): - confdir = os.path.join(THIS_DIR, 'static/') + confdir = os.path.join(THIS_DIR, "static/") config_data = cr.parse_config_file(confdir) with mock.patch("my.module.plt.show") as show_patch: line = plot_initializer(config_data) assert show_patch.called xlow, xhigh = line.get_xlim() - print (xlow) + print(xlow) ylow, yhigh = line.get_ylim() assert xlow == -2.5 assert xhigh == 2.5 @@ -24,8 +26,9 @@ def test_plot_initializer(): assert xlabel == "Voltage (V)" assert ylabel == "Current (mA)" + def test_plot_updater(): - confdir = os.path.join(THIS_DIR, 'static/') + confdir = os.path.join(THIS_DIR, "static/") config_data = cr.parse_config_file(confdir) with mock.patch("my.module.plt.show") as show_patch: line = plot_initializer(config_data)