コード例 #1
0
 def test_list(self):
     """
     Checking list
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url, 'url').list()
     self.assertEqual(actual_answer.next(), 'abdera/')
コード例 #2
0
 def test_log(self):
     """
     Checking log
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url,
                                  'url').log_default(revision_from=1761404,
                                                     revision_to=1761403)
     self.assertEqual(actual_answer.next().author, 'sseifert')
コード例 #3
0
 def test_cat(self):
     """
     Checking cat
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url,
                                  'url').cat('abdera/abdera2/README',
                                             revision=1761404)
     self.assertEqual(cat, actual_answer.decode())
コード例 #4
0
 def test_diff(self):
     """
     Checking diff
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url,
                                  'url').diff(self.test_start_revision,
                                              self.test_end_revision)
     for index, individual_diff in enumerate(actual_answer):
         for diff_key in individual_diff:
             if diff_key == 'diff':
                 self.assertTrue(
                     'sling/trunk/bundles/extensions/models/pom.xml'
                     in individual_diff[diff_key]
                     or 'sling/trunk/pom.xml' in individual_diff[diff_key])
                 self.assertTrue(
                     '<module>bundles/extensions/models</module>'
                     in individual_diff[diff_key]
                     or '<description>Apache Sling Models</description>'
                     in individual_diff[diff_key])
             elif diff_key == 'path':
                 self.assertTrue(
                     'http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/pom.xml'
                     in individual_diff[diff_key] or
                     'http://svn.apache.org/repos/asf/sling/trunk/pom.xml'
                     in individual_diff[diff_key])
コード例 #5
0
 def test_error_client_formation(self):
     """
     Testing SvnException error while client formation
     :return:
     """
     with self.assertRaises(SvnException):
         CommonClient(self.test_svn_url, 'random')
コード例 #6
0
ファイル: test_common.py プロジェクト: rnt/PySvn
 def test_error_client_formation(self):
     """
     Testing Value error while client formation
     :return:
     """
     with self.assertRaises(ValueError):
         CommonClient(self.test_svn_url, 'random')
コード例 #7
0
 def test_export(self):
     """
     Checking export
     :return:
     """
     CommonClient('http://svn.apache.org/repos/asf/tcl/websh/trunk/',
                  'url').export(to_path='CHANGES', revision=1761404)
     self.assertTrue(os.path.exists('CHANGES'))
コード例 #8
0
ファイル: test_common.py プロジェクト: rnt/PySvn
 def test_diff_summary(self):
     """
     Checking diff summary
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url, 'url').diff_summary(self.test_start_revision,
                                                                         self.test_end_revision)
     self.assertEqual(actual_answer, diff_summary)
コード例 #9
0
 def test_force_export(self):
     """
     Checking export with force option
     :return:
     """
     CommonClient('http://svn.apache.org/repos/asf/tcl/websh/trunk/',
                  'url').export(to_path='CHANGES', revision=1761404)
     self.assertTrue(os.path.exists('CHANGES'))
     with self.assertRaises(SvnException):
         CommonClient('http://svn.apache.org/repos/asf/tcl/websh/trunk/',
                      'url').export(to_path='CHANGES', revision=1761404)
     try:
         CommonClient('http://svn.apache.org/repos/asf/tcl/websh/trunk/',
                      'url').export(to_path='CHANGES',
                                    revision=1761404,
                                    force=True)
     except SvnException:
         self.fail("Svn Exception raised with Force also")
コード例 #10
0
 def test_info(self):
     """
     Checking info
     :return:
     """
     actual_answer = CommonClient(self.test_svn_url, 'url').info()
     self.assertEqual(actual_answer['entry_path'], 'asf')
     self.assertEqual(actual_answer['repository_root'],
                      'http://svn.apache.org/repos/asf')
     self.assertEqual(actual_answer['entry#kind'], 'dir')
     self.assertEqual(actual_answer['repository/uuid'],
                      '13f79535-47bb-0310-9956-ffa450edef68')