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

Unified Diff: appengine/findit/common/test/blame_test.py

Issue 2344443005: [Findit] Factoring the gitiles (etc) stuff out into its own directory (Closed)
Patch Set: rebase-update Created 4 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: appengine/findit/common/test/blame_test.py
diff --git a/appengine/findit/common/test/blame_test.py b/appengine/findit/common/test/blame_test.py
deleted file mode 100644
index 98fba608a83528c845fe9961cff81debb169bab4..0000000000000000000000000000000000000000
--- a/appengine/findit/common/test/blame_test.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# 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 common.blame import Blame
-from common.blame import Region
-
-class BlameTest(unittest.TestCase):
- REGION1 = Region(1, 5, 'abc', 'a', 'a@email.com', '2014-08-14 19:38:42')
- REGION1_EXPECTED_JSON = {
- 'start': 1,
- 'count': 5,
- 'revision': 'abc',
- 'author_name': 'a',
- 'author_email': 'a@email.com',
- 'author_time': '2014-08-14 19:38:42'
- }
-
- REGION2 = Region(6, 10, 'def', 'b', 'b@email.com', '2014-08-19 19:38:42')
- REGION2_EXPECTED_JSON = {
- 'start': 6,
- 'count': 10,
- 'revision': 'def',
- 'author_name': 'b',
- 'author_email': 'b@email.com',
- 'author_time': '2014-08-19 19:38:42'
- }
-
- def testRegionToDict(self):
- self.assertEqual(self.REGION1_EXPECTED_JSON, self.REGION1.ToDict())
- self.assertEqual(self.REGION2_EXPECTED_JSON, self.REGION2.ToDict())
-
- def testBlameToDict(self):
- blame = Blame('def', 'a/c.cc')
- blame.AddRegion(self.REGION1)
- blame.AddRegion(self.REGION2)
- blame_json = blame.ToDict()
- self.assertEqual(3, len(blame_json))
- self.assertEqual('def', blame_json['revision'])
- self.assertEqual('a/c.cc', blame_json['path'])
- self.assertEqual(self.REGION1_EXPECTED_JSON, blame_json['regions'][0])
- self.assertEqual(self.REGION2_EXPECTED_JSON, blame_json['regions'][1])

Powered by Google App Engine
This is Rietveld 408576698