-
Notifications
You must be signed in to change notification settings - Fork 7
Refactor/adapt legacy single table restore to use Async job #6
Conversation
|
||
app = webapp2.WSGIApplication([ | ||
webapp2.Route( | ||
'/restore/table/<project_id:.*>/<dataset_id:.*>/<table_id:.*>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL was supposed to be similar to the one from dataset restore so it should be:
/restore/project/<project_id:.>/dataset/<dataset_id:.>/table/<table_id:.*>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
TableRestoreHandler | ||
), | ||
webapp2.Route( | ||
'/restore/schedule/table/<project_id:.*>/<dataset_id:.*>/<table_id:.*>/<partition_id:.*>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The URL was supposed to be similar to the one from dataset restore so it should be:
/schedule/restore/project/<project_id:.>/dataset/<dataset_id:.>/table/<table_id:.*>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably don't need partition_id part here ?? it is provided as a request parameter (line 17)
@patch.object(BackupListRestoreService, 'restore') | ||
@patch.object(BackupFinder, 'for_table') | ||
@patch.object(uuid, 'uuid4', return_value=123) | ||
def test_happy_path(self, _, for_table, restore): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like "test_happy_path" name, I want sth which describe what should happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I did chang the name to 'test_service_call_backup_list_restore_with_one_item_only'.
And removed redundant checks, because it should test only that redirects to backup list restore service.
Pull Request Test Coverage Report for Build 179
💛 - Coveralls |
src/restore/table/backup_finder.py
Outdated
@@ -0,0 +1,34 @@ | |||
import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about moving this file to package: src.backup.datastore ?
No description provided.