File: test_scm.py

package info (click to toggle)
python-jenkinsapi 0.3.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,500 kB
  • sloc: python: 10,001; xml: 50; makefile: 31; sh: 26
file content (32 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# '''
# System tests for `jenkinsapi.jenkins` module.
# '''
# To run unittests on python 2.6 please use unittest2 library
# try:
# import unittest2 as unittest
# except ImportError:
# import unittest
# from jenkinsapi_tests.systests.base import BaseSystemTest
# from jenkinsapi_tests.test_utils.random_strings import random_string
# from jenkinsapi_tests.systests.job_configs import SCM_GIT_JOB

# # Maybe have a base class for all SCM test activites?
# class TestSCMGit(BaseSystemTest):
#     # Maybe it makes sense to move plugin dependencies outside the code.
#     # Have a config to dependencies mapping from the launcher can use
#     # to install plugins.
#     def test_get_revision(self):
#         job_name = 'git_%s' % random_string()
#         job = self.jenkins.create_job(job_name, SCM_GIT_JOB)
#         ii = job.invoke()
#         ii.block(until='completed')
#         self.assertFalse(ii.is_running())
#         b = ii.get_build()
#         try:
#             self.assertIsInstance(b.get_revision(), basestring)
#         except NameError:
#             # Python3
#             self.assertIsInstance(b.get_revision(), str)

# if __name__ == '__main__':
#     unittest.main()