Merge "test_uploads_with_nondefault_rebase: fix git screen scraping"

This commit is contained in:
Zuul 2018-12-14 16:21:56 +00:00 committed by Gerrit Code Review
commit a2bea9f57e

View File

@ -18,6 +18,7 @@
import json import json
import os import os
import shutil import shutil
import testtools
from git_review import tests from git_review import tests
from git_review.tests import utils from git_review.tests import utils
@ -286,9 +287,10 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
br_out = self._run_git('checkout', br_out = self._run_git('checkout',
'-b', 'test_branch', 'origin/maint') '-b', 'test_branch', 'origin/maint')
expected_track = 'Branch test_branch set up to track remote' + \ expected_track = ".*\nBranch '?test_branch'? set up to track remote" + \
' branch maint from origin.' " branch '?maint'? from '?origin'?."
self.assertIn(expected_track, br_out) track_matcher = testtools.matchers.MatchesRegex(expected_track)
self.assertThat(br_out, track_matcher)
branches = self._run_git('branch', '-a') branches = self._run_git('branch', '-a')
expected_branch = '* test_branch' expected_branch = '* test_branch'
observed = branches.split('\n') observed = branches.split('\n')