Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(649)

Side by Side Diff: chrome/test/functional/ispy/common/cloud_bucket.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Abstract injector class for GS requests."""
6
7
8 class FileNotFoundError(Exception):
9 """Thrown by a subclass of CloudBucket when a file is not found."""
10 pass
11
12
13 class BaseCloudBucket(object):
14 """An abstract base class for working with GS."""
15
16 def UploadFile(self, path, contents, content_type):
17 """Uploads a file to GS.
18
19 Args:
20 path: where in GS to upload the file.
21 contents: the contents of the file to be uploaded.
22 content_type: the MIME Content-Type of the file.
23 """
24 raise NotImplementedError
25
26 def DownloadFile(self, path):
27 """Downsloads a file from GS.
28
29 Args:
30 path: the location in GS to download the file from.
31
32 Returns:
33 String contents of the file downloaded.
34
35 Raises:
36 bucket_injector.NotFoundException: if the file is not found.
37 """
38 raise NotImplementedError
39
40 def UpdateFile(self, path, contents):
41 """Uploads a file to GS.
42
43 Args:
44 path: location of the file in GS to update.
45 contents: the contents of the file to be updated.
46 """
47 raise NotImplementedError
48
49 def RemoveFile(self, path):
50 """Removes a file from GS.
51
52 Args:
53 path: the location in GS to download the file from.
54 """
55 raise NotImplementedError
56
57 def FileExists(self, path):
58 """Checks if a file exists in GS.
59
60 Args:
61 path: the location in GS of the file.
62
63 Returns:
64 boolean representing whether the file exists in GS.
65 """
66 raise NotImplementedError
67
68 def GetImageURL(self, path):
69 """Gets a URL to an item in GS from its path.
70
71 Args:
72 path: the location in GS of a file.
73
74 Returns:
75 an url to a file in GS.
76
77 Raises:
78 bucket_injector.NotFoundException: if the file is not found.
79 """
80 raise NotImplementedError
81
82 def GetAllPaths(self, prefix):
83 """Gets paths to files in GS that start with a prefix.
84
85 Args:
86 prefix: the prefix to filter files in GS.
87
88 Returns:
89 a generator of paths to files in GS.
90 """
91 raise NotImplementedError
OLDNEW
« no previous file with comments | « chrome/test/functional/ispy/client/wait_on_ajax.js ('k') | chrome/test/functional/ispy/common/constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698