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

Unified Diff: tools/telemetry/telemetry/core/util_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
« no previous file with comments | « tools/telemetry/telemetry/core/util.py ('k') | tools/telemetry/telemetry/decorators.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/util_unittest.py
diff --git a/tools/telemetry/telemetry/core/util_unittest.py b/tools/telemetry/telemetry/core/util_unittest.py
deleted file mode 100644
index 0d8ace3dc13fbb6201634c86d38557803f177a98..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/core/util_unittest.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright 2012 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 os
-import shutil
-import tempfile
-import unittest
-
-from telemetry.core import exceptions
-from telemetry.core import util
-
-
-class TestWait(unittest.TestCase):
-
- def testNonTimeout(self):
-
- def test():
- return True
-
- util.WaitFor(test, 0.1)
-
- def testTimeout(self):
-
- def test():
- return False
-
- self.assertRaises(exceptions.TimeoutException,
- lambda: util.WaitFor(test, 0.1))
-
- def testCallable(self):
- """Test methods and anonymous functions, functions are tested elsewhere."""
-
- class Test(object):
-
- def Method(self):
- return 'test'
-
- util.WaitFor(Test().Method, 0.1)
-
- util.WaitFor(lambda: 1, 0.1)
-
- # Test noncallable condition.
- self.assertRaises(TypeError, lambda: util.WaitFor('test', 0.1))
-
- def testReturn(self):
- self.assertEquals('test', util.WaitFor(lambda: 'test', 0.1))
-
-
-class TestGetSequentialFileName(unittest.TestCase):
-
- def __init__(self, *args, **kwargs):
- super(TestGetSequentialFileName, self).__init__(*args, **kwargs)
- self.test_directory = None
-
- def setUp(self):
- self.test_directory = tempfile.mkdtemp()
-
- def testGetSequentialFileNameNoOtherSequentialFile(self):
- next_json_test_file_path = util.GetSequentialFileName(os.path.join(
- self.test_directory, 'test'))
- self.assertEquals(
- os.path.join(self.test_directory, 'test_000'), next_json_test_file_path)
-
- def testGetSequentialFileNameWithOtherSequentialFiles(self):
- # Create test_000.json, test_001.json, test_002.json in test directory.
- for i in xrange(3):
- with open(
- os.path.join(self.test_directory, 'test_%03d.json' % i), 'w') as _:
- pass
- next_json_test_file_path = util.GetSequentialFileName(os.path.join(
- self.test_directory, 'test'))
- self.assertEquals(
- os.path.join(self.test_directory, 'test_003'), next_json_test_file_path)
-
- def tearDown(self):
- shutil.rmtree(self.test_directory)
« no previous file with comments | « tools/telemetry/telemetry/core/util.py ('k') | tools/telemetry/telemetry/decorators.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698