Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add mock objects for future use.

  • Loading branch information...
commit 1139999d4a35e26c05d3863f175e7b7b8eda50c3 1 parent 8b5b04a
Zac authored
View
0  mocks/__init__.py
No changes.
View
27 mocks/mock_case.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockCase(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Case'
+ self['product'] = 'Test Product'
+ self['version'] = 'Test Version'
+ self['suite'] = None
+ self['desc'] = 'This is a test case'
+ self['step1_instruction'] = 'Test Case step 1 instruction'
+ self['step1_result'] = 'Test Case step 1 expected result'
+ self['status'] = 'active'
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
View
23 mocks/mock_product.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockProduct(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Product'
+ self['version'] = 'Test Version'
+ self['desc'] = 'This is a test product'
+ self['profile'] = None
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
View
22 mocks/mock_profile.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockProfile(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Profile'
+ self['category_name'] = 'Test Category'
+ self['element_name'] = 'Test Element'
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
View
25 mocks/mock_run.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockRun(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Run'
+ self['product_version'] = 'Test Product Test Version'
+ self['desc'] = 'This is a test run'
+ self['start_date'] = '2011-01-01'
+ self['end_date'] = '2012-12-31'
+ self['suite_list'] = None
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
View
24 mocks/mock_suite.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockSuite(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Suite'
+ self['product'] = 'Test Product'
+ self['desc'] = 'This is a test suite'
+ self['status'] = 'active'
+ self['case_list'] = None
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
View
21 mocks/mock_version.py
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+class MockVersion(dict):
+
+ def __init__(self, **kwargs):
+ # set your default values
+
+ self['name'] = 'Test Version'
+ self['product_name'] = 'Test Product'
+
+ # update with any keyword arguments passed
+ self.update(**kwargs)
+
+ # allow getting items as if they were attributes
+ def __getattr__(self, attr):
+ return self[attr]
Please sign in to comment.
Something went wrong with that request. Please try again.