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

Unified Diff: tools/telemetry/telemetry/testing/decorators_unittest.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
Index: tools/telemetry/telemetry/testing/decorators_unittest.py
diff --git a/tools/telemetry/telemetry/testing/decorators_unittest.py b/tools/telemetry/telemetry/testing/decorators_unittest.py
deleted file mode 100644
index f27d36c643c9b344837bf3d213a65444176a57bf..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/testing/decorators_unittest.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2014 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.
-
-import unittest
-
-from telemetry import decorators
-
-_counter = 0
-
-
-class Foo(object):
- @decorators.Cache
- def GetCountCached(self, _):
- global _counter
- _counter = _counter + 1
- return _counter
-
-
-def CreateFooUncached(_):
- return Foo()
-
-
-@decorators.Cache
-def CreateFooCached(_):
- return Foo()
-
-
-class DecoratorsUnitTest(unittest.TestCase):
- # pylint: disable=blacklisted-name
-
- def testCacheDecorator(self):
- self.assertNotEquals(CreateFooUncached(1), CreateFooUncached(2))
- self.assertNotEquals(CreateFooCached(1), CreateFooCached(2))
-
- self.assertNotEquals(CreateFooUncached(1), CreateFooUncached(1))
- self.assertEquals(CreateFooCached(1), CreateFooCached(1))
-
- def testCacheableMemberCachesOnlyForSameArgs(self):
- foo = Foo()
- value_of_one = foo.GetCountCached(1)
-
- self.assertEquals(value_of_one, foo.GetCountCached(1))
- self.assertNotEquals(value_of_one, foo.GetCountCached(2))
-
- def testCacheableMemberHasSeparateCachesForSiblingInstances(self):
- foo = Foo()
- sibling_foo = Foo()
-
- self.assertNotEquals(foo.GetCountCached(1), sibling_foo.GetCountCached(1))
-
- def testCacheableMemberHasSeparateCachesForNextGenerationInstances(self):
- foo = Foo()
- last_generation_count = foo.GetCountCached(1)
- foo = None
- foo = Foo()
-
- self.assertNotEquals(last_generation_count, foo.GetCountCached(1))
« no previous file with comments | « tools/telemetry/telemetry/testing/browser_test_case.py ('k') | tools/telemetry/telemetry/testing/disabled_cases.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698