Skip to content

Commit

Permalink
Fix schedules test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkubi committed Sep 11, 2022
1 parent 6026144 commit 14bf004
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions tests/client/schedules_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ def test_create_schedule(self, mock_api):
'mode': 'POST',
'data': {'name': 'test', 'minute': '*', 'hour': '1',
'day_of_week': 'pants', 'day_of_month': 'doggo',
'month': 'may', 'only_when_online': False,
'is_active': True},
}
self.api.client.servers.schedules.create_schedule(
'srv123', 'test', '*', '1', 'pants', 'doggo')
'srv123', 'test', '*', '1', 'pants', 'doggo', 'may')
mock_api.assert_called_with(**expected)

@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
Expand All @@ -45,10 +46,11 @@ def test_update_schedule(self, mock_api):
'mode': 'POST',
'data': {'name': 'test', 'minute': '*', 'hour': '1',
'day_of_week': 'pants', 'day_of_month': 'doggo',
'month': 'may', 'only_when_online': False,
'is_active': True},
}
self.api.client.servers.schedules.update_schedule(
'srv123', 4, 'test', '*', '1', 'pants', 'doggo')
'srv123', 4, 'test', '*', '1', 'pants', 'doggo', 'may')
mock_api.assert_called_with(**expected)

@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
Expand All @@ -66,7 +68,7 @@ def test_create_task(self, mock_api):
'endpoint': 'client/servers/srv123/schedules/5/tasks',
'mode': 'POST',
'data': {'action': 'command', 'payload': 'say Hello World',
'time_offset': '6'}
'time_offset': '6', 'continue_on_failure': False}
}
self.api.client.servers.schedules.create_task('srv123', 5, 'command',
'say Hello World', '6')
Expand All @@ -78,10 +80,11 @@ def test_update_task(self, mock_api):
'endpoint': 'client/servers/srv123/schedules/5/tasks/4',
'mode': 'POST',
'data': {'action': 'command', 'payload': 'say Hello World',
'time_offset': '6'}
'time_offset': '6', 'continue_on_failure': True}
}
self.api.client.servers.schedules.update_task('srv123', 5, 4, 'command',
'say Hello World', '6')
'say Hello World', '6',
True)
mock_api.assert_called_with(**expected)

@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
Expand Down

0 comments on commit 14bf004

Please sign in to comment.