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

Unified Diff: dashboard/dashboard/pinpoint/models/change/patch_test.py

Issue 3013013002: [pinpoint] Change refactor. (Closed)
Patch Set: UI Created 3 years, 3 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: dashboard/dashboard/pinpoint/models/change/patch_test.py
diff --git a/dashboard/dashboard/pinpoint/models/change/patch_test.py b/dashboard/dashboard/pinpoint/models/change/patch_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..c18e0c771aca427893cc54028e21aa8c7b80627c
--- /dev/null
+++ b/dashboard/dashboard/pinpoint/models/change/patch_test.py
@@ -0,0 +1,39 @@
+# 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.
+
+import unittest
+
+from dashboard.pinpoint.models.change import patch
+
+
+class PatchTest(unittest.TestCase):
+
+ def testPatch(self):
+ p = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
+
+ other_patch = patch.Patch(u'https://codereview.chromium.org',
+ 2851943002, 40001)
+ self.assertEqual(p, other_patch)
+ string = 'https://codereview.chromium.org/2851943002/40001'
+ self.assertEqual(str(p), string)
+ self.assertEqual(p.id_string, string)
+
+ def testAsDict(self):
+ p = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
+ expected = {
+ 'server': 'https://codereview.chromium.org',
+ 'issue': 2851943002,
+ 'patchset': 40001,
+ }
+ self.assertEqual(p.AsDict(), expected)
+
+ def testFromDict(self):
+ p = patch.Patch.FromDict({
+ 'server': 'https://codereview.chromium.org',
+ 'issue': 2851943002,
+ 'patchset': 40001,
+ })
+
+ expected = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
+ self.assertEqual(p, expected)

Powered by Google App Engine
This is Rietveld 408576698