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

Unified Diff: appengine/findit/libs/gitiles/test/blame_test.py

Issue 2590313002: Added Blame.AddReagions(iterable) method (Closed)
Patch Set: changing Blame.AddRegions to use list.extend Created 4 years 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/libs/gitiles/test/blame_test.py
diff --git a/appengine/findit/libs/gitiles/test/blame_test.py b/appengine/findit/libs/gitiles/test/blame_test.py
index 7c7f07171d49f088e8363b826d20bec04d2979fe..95d634d5036fcf75a75f74a1b136288acd42c003 100644
--- a/appengine/findit/libs/gitiles/test/blame_test.py
+++ b/appengine/findit/libs/gitiles/test/blame_test.py
@@ -28,14 +28,23 @@ class BlameTest(unittest.TestCase):
'author_time': '2014-08-19 19:38:42'
}
+ def testAddRegions(self):
+ blame1 = Blame('def', 'a/c.cc')
+ blame1.AddRegions([self.REGION1, self.REGION2])
+
+ blame2 = Blame('def', 'a/c.cc')
+ blame2.AddRegion(self.REGION1)
+ blame2.AddRegion(self.REGION2)
+
+ self.assertEqual(blame1, blame2)
+
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.AddRegions([self.REGION1, self.REGION2])
blame_json = blame.ToDict()
self.assertEqual(3, len(blame_json))
self.assertEqual('def', blame_json['revision'])
« no previous file with comments | « appengine/findit/libs/gitiles/blame.py ('k') | appengine/findit/util_scripts/git_checkout/test/local_git_parsers_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698