Skip to content

Commit

Permalink
URLs is not possessive
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Nov 12, 2022
1 parent f47505a commit 697c4dd
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 46 deletions.
4 changes: 2 additions & 2 deletions tests/test_alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def tests_abode_alarm_setup(self, m):

def tests_alarm_device_properties(self, m):
"""Check that the abode device properties are working."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -91,7 +91,7 @@ def tests_alarm_device_properties(self, m):

def tests_alarm_device_mode_changes(self, m):
"""Test that the abode alarm can change/report modes."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
10 changes: 5 additions & 5 deletions tests/test_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def tests_automation_init(self, m):

def tests_automation_refresh(self, m):
"""Check the automation Abode class refreshes."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -121,7 +121,7 @@ def tests_automation_refresh(self, m):

def tests_multiple_automations(self, m):
"""Check that multiple automations work and return correctly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -165,7 +165,7 @@ def tests_multiple_automations(self, m):

def tests_automation_class_reuse(self, m):
"""Check that automations reuse the same classes when refreshed."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -238,7 +238,7 @@ def tests_automation_class_reuse(self, m):

def tests_automation_enable(self, m):
"""Check that automations can change their enable state."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -319,7 +319,7 @@ def tests_automation_enable(self, m):

def tests_automation_trigger(self, m):
"""Check that automations can be triggered."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestBinarySensors:

def tests_binary_sensor_properties(self, m):
"""Tests that binary sensor device properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
18 changes: 8 additions & 10 deletions tests/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class TestDevice:

def tests_device_mapping_type_tag(self):
"""Check new device without type_tag raises exception."""
# Set up device
device = GLASS.device(
status=CONST.STATUS_ONLINE,
low_battery=True,
Expand All @@ -51,7 +50,6 @@ def tests_device_mapping_type_tag(self):

def tests_device_auto_naming(self):
"""Check the generic Abode device creates a name."""
# Set up device
source = GLASS.device(
status=CONST.STATUS_ONLINE,
low_battery=True,
Expand Down Expand Up @@ -120,7 +118,7 @@ def tests_device_init(self, m):

def tests_generic_device_refresh(self, m):
"""Check the generic Abode device class init's properly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand All @@ -146,7 +144,7 @@ def tests_generic_device_refresh(self, m):

def tests_multiple_devices(self, m):
"""Tests that multiple devices are returned properly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -185,7 +183,7 @@ def tests_multiple_devices(self, m):

def tests_unknown_devices(self, m):
"""Tests that multiple devices are returned properly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand All @@ -205,7 +203,7 @@ def tests_unknown_devices(self, m):

def tests_device_category_filter(self, m):
"""Tests that device category filter returns requested results."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -252,7 +250,7 @@ def tests_device_category_filter(self, m):

def tests_no_control_url(self, m):
"""Check that devices return false without control url's."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand All @@ -272,7 +270,7 @@ def tests_no_control_url(self, m):

def tests_device_status_changes(self, m):
"""Tests that device status changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -349,7 +347,7 @@ def tests_device_status_changes(self, m):

def tests_device_level_changes(self, m):
"""Tests that device level changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -419,7 +417,7 @@ def tests_device_level_changes(self, m):

def tests_all_devices(self, m):
"""Tests that all mocked devices are mapped correctly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_dimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestDimmer:

def tests_dimmer_device_properties(self, m):
"""Tests that dimmer light devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -78,7 +78,7 @@ def tests_dimmer_device_properties(self, m):

def tests_dimmer_status_changes(self, m):
"""Tests that dimmer device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_door_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestDoorLock:

def tests_lock_device_properties(self, m):
"""Tests that lock devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -70,7 +70,7 @@ def tests_lock_device_properties(self, m):

def tests_lock_device_mode_changes(self, m):
"""Tests that lock device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
18 changes: 9 additions & 9 deletions tests/test_event_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestEventController:

def tests_device_id_registration(self, m):
"""Tests that we can register for device events with a device id."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -56,7 +56,7 @@ def tests_device_id_registration(self, m):

def tests_device_registration(self, m):
"""Tests that we can register for device events with a device."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -87,7 +87,7 @@ def tests_device_registration(self, m):

def tests_device_all_unregistration(self, m):
"""Tests that we can unregister for all device events."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -121,7 +121,7 @@ def tests_device_all_unregistration(self, m):

def tests_invalid_device(self, m):
"""Tests that invalid devices are not registered."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -161,7 +161,7 @@ def tests_invalid_device(self, m):

def tests_invalid_all_device_unregister(self, m):
"""Tests that invalid devices are not all unregistered."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -240,7 +240,7 @@ def tests_timeline_registration(self):

def tests_device_callback(self, m):
"""Tests that device updates callback correctly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -357,7 +357,7 @@ def tests_timeline_callback(self):

def tests_alarm_callback(self, m):
"""Tests that alarm device updates callback correctly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -422,7 +422,7 @@ def _callback(event_json):

def tests_multi_device_callback(self, m):
"""Tests that multiple device updates callback correctly."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -461,7 +461,7 @@ def tests_multi_device_callback(self, m):
# Register our devices
assert events.add_device_callback([cover, doorcontact], callback)

# Set up device update URL's
# Set up device update URLs
cover_url = CONST.DEVICE_URL.format(device_id=COVER.DEVICE_ID)
m.get(
cover_url,
Expand Down
8 changes: 4 additions & 4 deletions tests/test_hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestHue:

def tests_hue_device_properties(self, m):
"""Tests that hue light devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -93,7 +93,7 @@ def tests_hue_device_properties(self, m):

def tests_hue_status_changes(self, m):
"""Tests that hue device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -164,7 +164,7 @@ def tests_hue_status_changes(self, m):

def tests_hue_color_temp_changes(self, m):
"""Tests that hue device color temp changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -231,7 +231,7 @@ def tests_hue_color_temp_changes(self, m):

def tests_hue_color_changes(self, m):
"""Tests that hue device color changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
6 changes: 3 additions & 3 deletions tests/test_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TestLM:

def tests_cover_lm_properties(self, m):
"""Tests that sensor/LM devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -88,7 +88,7 @@ def tests_cover_lm_properties(self, m):

def tests_lm_float_units(self, m):
"""Tests that sensor/LM devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -129,7 +129,7 @@ def tests_lm_float_units(self, m):

def tests_lm_temp_only(self, m):
"""Tests that sensor/LM devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_power_switch_meter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestPowerSwitchMeter:

def tests_switch_device_properties(self, m):
"""Tests that switch devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -70,7 +70,7 @@ def tests_switch_device_properties(self, m):

def tests_switch_status_changes(self, m):
"""Tests that switch device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_power_switch_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TestPowerSwitchSensor:

def tests_switch_device_properties(self, m):
"""Tests that switch devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -70,7 +70,7 @@ def tests_switch_device_properties(self, m):

def tests_switch_status_changes(self, m):
"""Tests that switch device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
4 changes: 2 additions & 2 deletions tests/test_secure_barrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestSecureBarrier:

def tests_cover_device_properties(self, m):
"""Tests that cover devices properties work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down Expand Up @@ -69,7 +69,7 @@ def tests_cover_device_properties(self, m):

def tests_cover_status_changes(self, m):
"""Tests that cover device changes work as expected."""
# Set up URL's
# Set up URLs
m.post(CONST.LOGIN_URL, json=LOGIN.post_response_ok())
m.get(CONST.OAUTH_TOKEN_URL, json=OAUTH_CLAIMS.get_response_ok())
m.post(CONST.LOGOUT_URL, json=LOGOUT.post_response_ok())
Expand Down
Loading

0 comments on commit 697c4dd

Please sign in to comment.