From ef1429224e74960f777074f970b03f5645e96a0d Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Sun, 17 Dec 2023 14:55:37 +0000 Subject: [PATCH] try to make black happy --- tests/test_program.py | 12 ++++++------ tests/test_summary.py | 6 +++--- tests/test_valve.py | 28 +++++++++++++--------------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/tests/test_program.py b/tests/test_program.py index 7728689..185e79d 100644 --- a/tests/test_program.py +++ b/tests/test_program.py @@ -33,7 +33,7 @@ def test_list_programs(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( args[1], f"{VALVE_API_URL}/program/listPrograms/{valveid}" - ) + ) self.assertEqual(args[0], "GET") self.assertEqual(kwargs["data"], None) @@ -51,7 +51,7 @@ def test_get_program(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( args[1], f"{VALVE_API_URL}/program/getProgram/{programid}" - ) + ) self.assertEqual(args[0], "GET") self.assertEqual(kwargs["data"], None) @@ -70,11 +70,11 @@ def test_create_skip_overrides(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( args[1], f"{VALVE_API_URL}/program/createSkipOverrides" - ) + ) self.assertEqual(args[0], "POST") self.assertEqual( kwargs["data"], - json.dumps({"programId": programid, "timestamp": timestamp}) + json.dumps({"programId": programid, "timestamp": timestamp}), ) @patch("requests.Session.request") @@ -92,9 +92,9 @@ def test_delete_skip_overrides(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( args[1], f"{VALVE_API_URL}/program/deleteSkipOverrides" - ) + ) self.assertEqual(args[0], "POST") self.assertEqual( kwargs["data"], - json.dumps({"programId": programid, "timestamp": timestamp}) + json.dumps({"programId": programid, "timestamp": timestamp}), ) diff --git a/tests/test_summary.py b/tests/test_summary.py index 979c359..651a0e7 100644 --- a/tests/test_summary.py +++ b/tests/test_summary.py @@ -41,7 +41,7 @@ def test_get_valve_day_views(self, mock): { "resourceId": {"baseStationId": deviceid}, "start": start, - "end": end + "end": end, } - ) - ) + ), + ) diff --git a/tests/test_valve.py b/tests/test_valve.py index 8f4a6c2..a4e5b65 100644 --- a/tests/test_valve.py +++ b/tests/test_valve.py @@ -49,9 +49,8 @@ def test_get_base_station(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( - args[1], - f"{VALVE_API_URL}/valve/getBaseStation/{baseid}" - ) + args[1], f"{VALVE_API_URL}/valve/getBaseStation/{baseid}" + ) self.assertEqual(args[0], "GET") self.assertEqual(kwargs["data"], None) @@ -68,9 +67,8 @@ def test_list_base_stations(self, mock): # Check that the mock function is called with the rights args. self.assertEqual( - args[1], - f"{VALVE_API_URL}/valve/listBaseStations/{userid}" - ) + args[1], f"{VALVE_API_URL}/valve/listBaseStations/{userid}" + ) self.assertEqual(args[0], "GET") self.assertEqual(kwargs["data"], None) @@ -107,16 +105,18 @@ def test_set_default_runtime(self, mock): self.assertEqual(args[0], "PUT") self.assertEqual( kwargs["data"], - json.dumps({"valveId": valveid, "defaultRuntimeSeconds": duration}) + json.dumps( + {"valveId": valveid, "defaultRuntimeSeconds": duration} + ), ) # Check that values should be within range. self.assertRaises( AssertionError, self.valve.start_watering, valveid, -1 - ) + ) self.assertRaises( AssertionError, self.valve.start_watering, valveid, 86401 - ) + ) @patch("requests.Session.request") def test_start_watering(self, mock): @@ -135,16 +135,16 @@ def test_start_watering(self, mock): self.assertEqual(args[0], "PUT") self.assertEqual( kwargs["data"], - json.dumps({"valveId": valveid, "durationSeconds": duration}) + json.dumps({"valveId": valveid, "durationSeconds": duration}), ) # Check that values should be within range. self.assertRaises( AssertionError, self.valve.start_watering, valveid, -1 - ) + ) self.assertRaises( AssertionError, self.valve.start_watering, valveid, 86401 - ) + ) @patch("requests.Session.request") def test_stop_watering(self, mock): @@ -160,6 +160,4 @@ def test_stop_watering(self, mock): # Check that the mock function is called with the rights args. self.assertEqual(args[1], f"{VALVE_API_URL}/valve/stopWatering") self.assertEqual(args[0], "PUT") - self.assertEqual( - kwargs["data"], json.dumps({"valveId": valveid}) - ) + self.assertEqual(kwargs["data"], json.dumps({"valveId": valveid}))