<s> import os <EOL> from pprint import pformat <EOL> from testscenarios import TestWithScenarios <EOL> from testtools . content import text_content <EOL> from git_upstream . lib . searchers import UpstreamMergeBaseSearcher <EOL> from git_upstream . tests . base import BaseTestCase <EOL> from git_upstream . tests . base import get_scenarios <EOL> class TestUpstreamMergeBaseSearcher ( TestWithScenarios , BaseTestCase ) : <EOL> scenarios = get_scenarios ( os . path . join ( os . path . dirname ( __file__ ) , <EOL> "<STR_LIT>" ) ) <EOL> def setUp ( self ) : <EOL> self . addDetail ( '<STR_LIT:description>' , text_content ( self . desc ) ) <EOL> super ( TestUpstreamMergeBaseSearcher , self ) . setUp ( ) <EOL> self . addDetail ( '<STR_LIT>' , <EOL> text_content ( pformat ( <EOL> list ( ( c , self . _graph [ c ] . hexsha ) <EOL> for c in self . expected_changes ) ) ) ) <EOL> def test_search_changes ( self ) : <EOL> if getattr ( self , '<STR_LIT>' , None ) : <EOL> pattern = [ self . pattern ] <EOL> else : <EOL> pattern = None <EOL> searcher = UpstreamMergeBaseSearcher ( branch = self . branches [ '<STR_LIT>' ] [ <NUM_LIT:0> ] , <EOL> patterns = pattern , repo = self . repo ) <EOL> self . assertEqual ( <EOL> self . _commits_from_nodes ( reversed ( self . expected_changes ) ) , <EOL> searcher . list ( ) ) </s>
