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

Unified Diff: tests/git_footers_test.py

Issue 1915833003: tryserver recipe_module: Add get_tags. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Minor things. Created 4 years, 7 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 | « tests/gclient_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_footers_test.py
diff --git a/tests/git_footers_test.py b/tests/git_footers_test.py
index c959949f9106d534ff7bd015d328e852b31ca1f8..23ca473637f883f10360567db721caee6fca6214 100755
--- a/tests/git_footers_test.py
+++ b/tests/git_footers_test.py
@@ -3,14 +3,17 @@
"""Tests for git_footers."""
import os
+import StringIO
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from testing_support.auto_stub import TestCase
+
import git_footers
-class GitFootersTest(unittest.TestCase):
+class GitFootersTest(TestCase):
_message = """
This is my commit message. There are many like it, but this one is mine.
@@ -104,6 +107,17 @@ My commit message is my best friend. It is my life. I must master it.
git_footers.add_footer_change_id('header: like footer', 'Ixxx'),
'header: like footer\n\nChange-Id: Ixxx')
+ def testReadStdin(self):
+ self.mock(git_footers.sys, 'stdin', StringIO.StringIO(
+ 'line\r\notherline\r\n\r\n\r\nFoo: baz'))
+
+ stdout = StringIO.StringIO()
+ self.mock(git_footers.sys, 'stdout', stdout)
+
+ self.assertEqual(git_footers.main([]), 0)
+ self.assertEqual(stdout.getvalue(), "Foo: baz\n")
+
+
if __name__ == '__main__':
unittest.main()
« no previous file with comments | « tests/gclient_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698