Exemple #1
0
 def test_init_defaults(self):
     runGitFlow('init', '--defaults')
     gitflow = GitFlow('.').init()
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('develop', gitflow.develop_name())
     self.assertEquals('feature/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('support/', gitflow.get_prefix('support'))
     self.assertEquals('', gitflow.get_prefix('versiontag'))
Exemple #2
0
 def test_init_defaults(self):
     run_git_flow('init', '--defaults')
     gitflow = GitFlow('.').init()
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('develop', gitflow.develop_name())
     self.assertEquals('feature/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('support/', gitflow.get_prefix('support'))
     self.assertEquals('', gitflow.get_prefix('versiontag'))
Exemple #3
0
 def test_init_force_defaults_succeeds_if_already_initialized(self):
     run_git_flow('init', '--defaults', '--force')
     gitflow = GitFlow('.').init()
     # these are the values already defined in custom_repo
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('production', gitflow.master_name())
     self.assertEquals('master', gitflow.develop_name())
     self.assertEquals('f-', gitflow.get_prefix('feature'))
     self.assertEquals('rel-', gitflow.get_prefix('release'))
     self.assertEquals('hf-', gitflow.get_prefix('hotfix'))
     self.assertEquals('supp-', gitflow.get_prefix('support'))
     self.assertEquals('v', gitflow.get_prefix('versiontag'))
Exemple #4
0
 def test_init_force_succeeds_if_already_initialized(self):
     # NB: switching master and develop
     text = '\n'.join(['my-remote', 'master', 'production',
                       'feat/', 'rel/', 'hf/', 'sup/', 'ver'])
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         runGitFlow('init', '--force')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('production', gitflow.develop_name())
Exemple #5
0
 def test_init_force_defaults_succeeds_if_already_initialized(self):
     runGitFlow('init', '--defaults', '--force')
     gitflow = GitFlow('.').init()
     # these are the values already defined in custom_repo
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('production', gitflow.master_name())
     self.assertEquals('master', gitflow.develop_name())
     self.assertEquals('f-', gitflow.get_prefix('feature'))
     self.assertEquals('rel-', gitflow.get_prefix('release'))
     self.assertEquals('hf-', gitflow.get_prefix('hotfix'))
     self.assertEquals('supp-', gitflow.get_prefix('support'))
     self.assertEquals('v', gitflow.get_prefix('versiontag'))
Exemple #6
0
 def test_init_force_succeeds_if_already_initialized(self):
     # NB: switching master and develop
     text = '\n'.join(['my-remote', 'master', 'production',
                       'feat/', 'rel/', 'hf/', 'sup/', 'ver'])
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         runGitFlow('init', '--force')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('production', gitflow.develop_name())
Exemple #7
0
 def test_init_accepting_defaults(self):
     text = u'\n' * 8
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         run_git_flow('init')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('develop', gitflow.develop_name())
     self.assertEquals('feature/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('support/', gitflow.get_prefix('support'))
     self.assertEquals('', gitflow.get_prefix('versiontag'))
Exemple #8
0
 def test_init_accepting_defaults(self):
     text = '\n'*8
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         runGitFlow('init')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('origin', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('develop', gitflow.develop_name())
     self.assertEquals('feature/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('support/', gitflow.get_prefix('support'))
     self.assertEquals('', gitflow.get_prefix('versiontag'))
Exemple #9
0
 def test_init_custom_accepting_some_defaults(self):
     text = u'\n'.join(
         ['my-remote', '', 'devel', 'feat/', '', '', 'sup/', 'v'])
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         run_git_flow('init')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('my-remote', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('devel', gitflow.develop_name())
     self.assertEquals('feat/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('sup/', gitflow.get_prefix('support'))
     self.assertEquals('v', gitflow.get_prefix('versiontag'))
Exemple #10
0
 def test_init_custom_accepting_some_defaults(self):
     text = '\n'.join(['my-remote', '', 'devel',
                       'feat/', '', '', 'sup/', 'v'])
     _stdin, sys.stdin = sys.stdin, StringIO(text)
     try:
         runGitFlow('init')
     finally:
         sys.stdin = _stdin
     gitflow = GitFlow('.').init()
     self.assertEquals('my-remote', gitflow.origin_name())
     self.assertEquals('master', gitflow.master_name())
     self.assertEquals('devel', gitflow.develop_name())
     self.assertEquals('feat/', gitflow.get_prefix('feature'))
     self.assertEquals('release/', gitflow.get_prefix('release'))
     self.assertEquals('hotfix/', gitflow.get_prefix('hotfix'))
     self.assertEquals('sup/', gitflow.get_prefix('support'))
     self.assertEquals('v', gitflow.get_prefix('versiontag'))