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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import unittest
6
7 from dashboard.pinpoint.models.change import patch
8
9
10 class PatchTest(unittest.TestCase):
11
12 def testPatch(self):
13 p = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
14
15 other_patch = patch.Patch(u'https://codereview.chromium.org',
16 2851943002, 40001)
17 self.assertEqual(p, other_patch)
18 string = 'https://codereview.chromium.org/2851943002/40001'
19 self.assertEqual(str(p), string)
20 self.assertEqual(p.id_string, string)
21
22 def testAsDict(self):
23 p = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
24 expected = {
25 'server': 'https://codereview.chromium.org',
26 'issue': 2851943002,
27 'patchset': 40001,
28 }
29 self.assertEqual(p.AsDict(), expected)
30
31 def testFromDict(self):
32 p = patch.Patch.FromDict({
33 'server': 'https://codereview.chromium.org',
34 'issue': 2851943002,
35 'patchset': 40001,
36 })
37
38 expected = patch.Patch('https://codereview.chromium.org', 2851943002, 40001)
39 self.assertEqual(p, expected)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698