diff --git a/testing/test/__init__.py b/testing/test/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/testing/test/__init__.py
diff --git a/testing/test/fake_test.py b/testing/test/fake_test.py
new file mode 100644
index 0000000..c098236
--- /dev/null
+++ b/testing/test/fake_test.py
@@ -0,0 +1,67 @@
+# Copyright 2016 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 or at
+# https://developers.google.com/open-source/licenses/bsd
+
+"""Tests for the fake module."""
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+
+import inspect
+import unittest
+
+from services import cachemanager_svc
+from services import config_svc
+from services import features_svc
+from services import issue_svc
+from services import project_svc
+from services import star_svc
+from services import user_svc
+from services import usergroup_svc
+from testing import fake
+
+fake_class_map = {
+    fake.AbstractStarService: star_svc.AbstractStarService,
+    fake.CacheManager: cachemanager_svc.CacheManager,
+    fake.ProjectService: project_svc.ProjectService,
+    fake.ConfigService: config_svc.ConfigService,
+    fake.IssueService: issue_svc.IssueService,
+    fake.UserGroupService: usergroup_svc.UserGroupService,
+    fake.UserService: user_svc.UserService,
+    fake.FeaturesService: features_svc.FeaturesService,
+    }
+
+
+class FakeMetaTest(unittest.TestCase):
+
+  def testFunctionsHaveSameSignatures(self):
+    """Verify that the fake class methods match the real ones."""
+    for fake_cls, real_cls in fake_class_map.items():
+      fake_attrs = set(dir(fake_cls))
+      real_attrs = set(dir(real_cls))
+      both_attrs = fake_attrs.intersection(real_attrs)
+      to_test = [x for x in both_attrs if '__' not in x]
+      for name in to_test:
+        real_attr = getattr(real_cls, name)
+        assert inspect.ismethod(real_attr)
+        real_spec = inspect.getargspec(real_attr)
+        fake_spec = inspect.getargspec(getattr(fake_cls, name))
+        # check same number of args and kwargs
+        real_kw_len = len(real_spec[3]) if real_spec[3] else 0
+        fake_kw_len = len(fake_spec[3]) if fake_spec[3] else 0
+
+        self.assertEqual(
+            len(real_spec[0]) - real_kw_len,
+            len(fake_spec[0]) - fake_kw_len,
+            'Unequal number of args on %s.%s' % (fake_cls.__name__, name))
+        self.assertEqual(
+            real_kw_len, fake_kw_len,
+            'Unequal number of kwargs on %s.%s' % (fake_cls.__name__, name))
+        if real_kw_len:
+          self.assertEqual(
+              real_spec[0][-real_kw_len:], fake_spec[0][-fake_kw_len:],
+              'Mismatched kwargs on %s.%s' % (fake_cls.__name__, name))
+        self.assertEqual(
+            real_spec[3], fake_spec[3],
+            'Mismatched kwarg defaults on %s.%s' % (fake_cls.__name__, name))
diff --git a/testing/test/testing_helpers_test.py b/testing/test/testing_helpers_test.py
new file mode 100644
index 0000000..7493b04
--- /dev/null
+++ b/testing/test/testing_helpers_test.py
@@ -0,0 +1,74 @@
+# Copyright 2016 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 or at
+# https://developers.google.com/open-source/licenses/bsd
+
+"""Tests for the testing_helpers module."""
+from __future__ import print_function
+from __future__ import division
+from __future__ import absolute_import
+
+import unittest
+
+from testing import testing_helpers
+
+
+class TestingHelpersTest(unittest.TestCase):
+
+  def testMakeMonorailRequest(self):
+    mr = testing_helpers.MakeMonorailRequest(
+        path='/foo?key1=2&key2=&key3')
+
+    self.assertEqual(None, mr.GetIntParam('foo'))
+    self.assertEqual(2, mr.GetIntParam('key1'))
+    self.assertEqual(None, mr.GetIntParam('key2'))
+    self.assertEqual(None, mr.GetIntParam('key3'))
+    self.assertEqual(3, mr.GetIntParam('key2', default_value=3))
+    self.assertEqual(3, mr.GetIntParam('foo', default_value=3))
+
+  def testGetRequestObjectsBasics(self):
+    request, mr = testing_helpers.GetRequestObjects(
+        path='/foo/bar/wee?sna=foo',
+        params={'ya': 'hoo'}, method='POST')
+
+    # supplied as part of the url
+    self.assertEqual('foo', mr.GetParam('sna'))
+
+    # supplied as a param
+    self.assertEqual('hoo', mr.GetParam('ya'))
+
+    # default Host header
+    self.assertEqual('127.0.0.1', request.host)
+
+  def testGetRequestObjectsHeaders(self):
+    # with some headers
+    request, _mr = testing_helpers.GetRequestObjects(
+        headers={'Accept-Language': 'en', 'Host': 'pickledsheep.com'},
+        path='/foo/bar/wee?sna=foo')
+
+    # default Host header
+    self.assertEqual('pickledsheep.com', request.host)
+
+    # user specified headers
+    self.assertEqual('en', request.headers['Accept-Language'])
+
+  def testGetRequestObjectsUserInfo(self):
+    user_id = '123'
+
+    _request, mr = testing_helpers.GetRequestObjects(
+        user_info={'user_id': user_id})
+
+    self.assertEqual(user_id, mr.auth.user_id)
+
+
+class BlankTest(unittest.TestCase):
+
+  def testBlank(self):
+    blank = testing_helpers.Blank(
+        foo='foo',
+        bar=123,
+        inc=lambda x: x + 1)
+
+    self.assertEqual('foo', blank.foo)
+    self.assertEqual(123, blank.bar)
+    self.assertEqual(5, blank.inc(4))
