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

Unified Diff: tests/model_test.py

Issue 25536018: Support revisions with str type for try jobs. Base URL: https://src.chromium.org/chrome/trunk/tools/commit-queue/
Patch Set: Created 7 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 | « pending_manager.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/model_test.py
===================================================================
--- tests/model_test.py (revision 226737)
+++ tests/model_test.py (working copy)
@@ -71,7 +71,7 @@
l = (Basic, dict)
-class StrDisallowed(PersistentMixIn):
+class StrAllowed(PersistentMixIn):
m = str
@@ -228,8 +228,13 @@
}
self.assertEqual(expected, data.as_dict())
- def testStrDisallowed(self):
- self.assertRaises(TypeError, StrDisallowed)
+ def testStrAllowed(self):
+ data = StrAllowed(m='foo')
+ expected = {
+ 'm': 'foo',
+ TYPE_FLAG: 'StrAllowed',
+ }
+ self.assertEqual(expected, data.as_dict())
class Deserialize(Base):
@@ -377,11 +382,13 @@
actual = PersistentMixIn.from_dict(marshall(data))
self._check(actual, TypeOrDict, l={'foo': 'bar'})
- def testStrDisallowed(self):
+ def testStrAllowed(self):
data = {
- TYPE_FLAG: 'StrDisallowed',
+ 'm': 'bar',
+ TYPE_FLAG: 'StrAllowed',
}
- self.assertRaises(TypeError, PersistentMixIn.from_dict, marshall(data))
+ actual = PersistentMixIn.from_dict(marshall(StrAllowed(m='bar')))
+ self._check(actual, StrAllowed, m='bar')
class Mutable(object):
« no previous file with comments | « pending_manager.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698