예제 #1
0
 def test_main_empty(self):
     self.main_setup()
     svn_rebase.sys.argv = ['svn_rebase', '']
     try:
         svn_rebase.main()
     except SystemExit:
         pass
     self.assertFalse(svn_rebase.svn_rebase.called)
예제 #2
0
 def test_main_abort(self):
     self.main_setup()
     self.options.abort = True
     svn_rebase.sys.argv = ['svn_rebase', '-a']
     try:
         svn_rebase.main()
     except SystemExit:
         pass
     self.assertTrue(svn_rebase.remove_state_file.called)
     self.assertFalse(svn_rebase.svn_rebase.called)
예제 #3
0
 def test_main_continue_with_other_args(self):
     self.main_setup()
     self.options.cont = True
     self.options.abort = True
     svn_rebase.sys.argv = ['svn_rebase', '-c', '-a']
     try:
         svn_rebase.main()
     except SystemExit:
         pass
     self.assertFalse(svn_rebase.svn_rebase.called)
예제 #4
0
 def test_main_continue_without_saved_state(self):
     self.main_setup()
     svn_rebase.load_state.return_value = None
     self.options.cont = True
     svn_rebase.sys.argv = ['svn_rebase', '-c']
     try:
         svn_rebase.main()
     except SystemExit:
         pass
     self.assertFalse(svn_rebase.svn_rebase.called)
예제 #5
0
 def test_main_abort_with_other_args(self):
     self.main_setup()
     self.options.abort = True
     self.options.revisions = '123'
     svn_rebase.sys.argv = ['svn_rebase', '-c', '-r123']
     try:
         svn_rebase.main()
     except SystemExit:
         pass
     self.assertFalse(svn_rebase.remove_state_file.called)
     self.assertFalse(svn_rebase.svn_rebase.called)
예제 #6
0
    def test_main_continue(self):
        self.main_setup()
        svn_rebase.load_state.return_value = {
                'source': 'http://nohost/svn/',
                }
        self.options.cont = True
        svn_rebase.sys.argv = ['svn_rebase', '-c']
        svn_rebase.main()

        self.assertTrue(svn_rebase.svn_rebase.called)
        self.assertEqual(svn_rebase.svn_rebase.call_args[1],
                {'source': 'http://nohost/svn/'})
예제 #7
0
 def test_main(self):
     self.args = ['http://nohost/svn/']
     self.options.revisions = '1234'
     self.options.destination = 'src'
     self.options.auto_commit = False
     self.main_setup()
     svn_rebase.sys.argv = ['svn_rebase', 'http://nohost/svn/']
     svn_rebase.main()
     self.assertTrue(svn_rebase.svn_rebase.called)
     self.assertTrue(svn_rebase.svn_rebase.call_args[1], {
         'source': 'http://nohost/svn/',
         'revisions': '1234',
         'destination': 'src',
         'auto_commit': False,
         })