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

Unified Diff: tools/telemetry/telemetry/util/classes_unittest.py

Issue 625123002: Make credential_path a page attribute instead of page_set attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert changes to path & path_unittest Created 6 years, 2 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/util/classes.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/util/classes_unittest.py
diff --git a/tools/telemetry/telemetry/util/classes_unittest.py b/tools/telemetry/telemetry/util/classes_unittest.py
new file mode 100644
index 0000000000000000000000000000000000000000..87173682de429b9497a13715aafc999ee54de912
--- /dev/null
+++ b/tools/telemetry/telemetry/util/classes_unittest.py
@@ -0,0 +1,45 @@
+# 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.util import classes
+
+
+class ClassWithoutInitDefOne: # pylint: disable=W0232
+ pass
+
+
+class ClassWithoutInitDefTwo(object):
+ pass
+
+
+class ClassWhoseInitOnlyHasSelf(object):
+ def __init__(self):
+ pass
+
+
+class ClassWhoseInitWithDefaultArguments(object):
+ def __init__(self, dog=1, cat=None, cow=None, fud='a'):
+ pass
+
+
+class ClassWhoseInitWithDefaultArgumentsAndNonDefaultArguments(object):
+ def __init__(self, x, dog=1, cat=None, fish=None, fud='a'):
+ pass
+
+
+class ClassesUnitTest(unittest.TestCase):
+
+ def testIsDirectlyConstructableReturnsTrue(self):
+ self.assertTrue(classes.IsDirectlyConstructable(ClassWithoutInitDefOne))
+ self.assertTrue(classes.IsDirectlyConstructable(ClassWithoutInitDefTwo))
+ self.assertTrue(classes.IsDirectlyConstructable(ClassWhoseInitOnlyHasSelf))
+ self.assertTrue(
+ classes.IsDirectlyConstructable(ClassWhoseInitWithDefaultArguments))
+
+ def testIsDirectlyConstructableReturnsFalse(self):
+ self.assertFalse(
+ classes.IsDirectlyConstructable(
+ ClassWhoseInitWithDefaultArgumentsAndNonDefaultArguments))
« no previous file with comments | « tools/telemetry/telemetry/util/classes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698