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

Unified Diff: chrome/test/functional/ispy/common/mock_cloud_bucket.py

Issue 222873002: Remove pyauto tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/functional/ispy/common/ispy_utils_unittest.py ('k') | chrome/test/functional/ispy/ispy_api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/functional/ispy/common/mock_cloud_bucket.py
===================================================================
--- chrome/test/functional/ispy/common/mock_cloud_bucket.py (revision 261231)
+++ chrome/test/functional/ispy/common/mock_cloud_bucket.py (working copy)
@@ -1,65 +0,0 @@
-# Copyright 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Subclass of CloudBucket used for testing."""
-
-import os
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
-import cloud_bucket
-
-
-class MockCloudBucket(cloud_bucket.BaseCloudBucket):
- """Subclass of CloudBucket used for testing."""
-
- def __init__(self):
- """Initializes the MockCloudBucket with its datastore.
-
- Returns:
- An instance of MockCloudBucket.
- """
- self.datastore = {}
-
- def Reset(self):
- """Clears the MockCloudBucket's datastore."""
- self.datastore = {}
-
- # override
- def UploadFile(self, path, contents, content_type):
- self.datastore[path] = contents
-
- # override
- def DownloadFile(self, path):
- if self.datastore.has_key(path):
- return self.datastore[path]
- else:
- raise cloud_bucket.FileNotFoundError
-
- # override
- def UpdateFile(self, path, contents):
- if not self.FileExists(path):
- raise cloud_bucket.FileNotFoundError
- self.UploadFile(path, contents, '')
-
- # override
- def RemoveFile(self, path):
- if self.datastore.has_key(path):
- self.datastore.pop(path)
-
- # override
- def FileExists(self, path):
- return self.datastore.has_key(path)
-
- # override
- def GetImageURL(self, path):
- if self.datastore.has_key(path):
- return path
- else:
- raise cloud_bucket.FileNotFoundError
-
- # override
- def GetAllPaths(self, prefix):
- return (item[0] for item in self.datastore.items()
- if item[0].startswith(prefix))
« no previous file with comments | « chrome/test/functional/ispy/common/ispy_utils_unittest.py ('k') | chrome/test/functional/ispy/ispy_api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698