bitbucket_server.py 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. EXAMPLE_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
  2. MIICWwIBAAKBgQC1cd9t8sA03awggLiX2gjZxyvOVUPJksLly1E662tttTeR3Wm9
  3. eo6onNeI8HRD+O4wubUp4h4Chc7DtLDmFEPhUZ8Qkwztiifm99Xo3s0nUq4Pygp5
  4. AU09KXTEPbzHLh1dnXLcxVLmGDE4drh0NWmYsd/Zp7XNIZq2TRQQ3NTdVQIDAQAB
  5. AoGAFwMyS0eWiR30TssEnn3Q0Y4pSCoYRuCOR4bZ7pcdMPTi72UdnCKHJWt/Cqc0
  6. l8piq1tiVsWO+NLvvnKUXRoE4cAyrGrpf1F0uP5zYW71SQALc9wwsjDzuj7BZEuK
  7. fg35JSceLHWE1WtzPDX5Xg20YPnMrA/xe/RwuPjuBH0wSqECQQDizzmKdKCq0ejy
  8. 3OxEto5knqpSEgRcOk0HDsdgjwkwiZJOj5ECV2FKpNHuu2thGy/aDJyLlmUso8j0
  9. OpvLAzOvAkEAzMwAgGexTxKm8hy3ilvVn9EvhSKjaIakqY4ONK9LZ4zMiDHI0H6C
  10. FXlwWX7CJM0YVFMubj8SB8rnIuvFDEBMOwJABHtRyMGbNyTktH/XD1iIIcbc2LhQ
  11. a74fLYeGOws4hEQDpxfBJsmxO3dcSppbedS+slFTepKjNymZW/IYh/9tMwJAEL5E
  12. 9DqGBn7x4y1x2//yESTbC7lvPqZzY+FXS/tg4NBkEGZxkoolPHg3NTnlyXhzGsHK
  13. M/04DicKipJYA85l7QJAJ3u67qZXecM/oWTtJToBDuyKGHfdY1564+RbyDEjJJRb
  14. vz4O/8FQQ1sGjdEBMMrRBCHEG8o3/XDTrB97t45TeA==
  15. -----END RSA PRIVATE KEY-----"""
  16. COMPARE_COMMITS_EXAMPLE = {
  17. "values": [
  18. {
  19. "id": "e18e4e72de0d824edfbe0d73efe34cbd0d01d301",
  20. "displayId": "e18e4e72de0",
  21. "author": {
  22. "name": "SentryU",
  23. "displayName": "Sentry User",
  24. "emailAddress": "sentryuser@getsentry.com",
  25. "type": "NORMAL",
  26. },
  27. "message": "README.md edited online with Bitbucket",
  28. "authorTimestamp": 1576763816000,
  29. }
  30. ]
  31. }
  32. COMMIT_CHANGELIST_EXAMPLE = {
  33. "values": [
  34. {
  35. "path": {
  36. "components": ["a.txt"],
  37. "parent": "",
  38. "name": "a.txt",
  39. "extension": "txt",
  40. "toString": "a.txt",
  41. },
  42. "executable": False,
  43. "percentUnchanged": -1,
  44. "type": "MODIFY",
  45. "nodeType": "FILE",
  46. "srcExecutable": False,
  47. "properties": {"gitChangeType": "MODIFY"},
  48. },
  49. {
  50. "path": {
  51. "components": ["b.txt"],
  52. "parent": "",
  53. "name": "b.txt",
  54. "extension": "txt",
  55. "toString": "b.txt",
  56. },
  57. "executable": False,
  58. "percentUnchanged": -1,
  59. "type": "ADD",
  60. "nodeType": "FILE",
  61. "srcExecutable": False,
  62. "properties": {"gitChangeType": "ADD"},
  63. },
  64. {
  65. "path": {
  66. "components": ["c.txt"],
  67. "parent": "",
  68. "name": "c.txt",
  69. "extension": "txt",
  70. "toString": "c.txt",
  71. },
  72. "executable": False,
  73. "percentUnchanged": -1,
  74. "type": "DELETE",
  75. "nodeType": "FILE",
  76. "srcExecutable": False,
  77. "properties": {"gitChangeType": "DELETE"},
  78. },
  79. {
  80. "path": {
  81. "components": ["e.txt"],
  82. "parent": "",
  83. "name": "d.txt",
  84. "extension": "txt",
  85. "toString": "d.txt",
  86. },
  87. "srcPath": {
  88. "components": ["d.txt"],
  89. "parent": "",
  90. "name": "e.txt",
  91. "extension": "txt",
  92. "toString": "e.txt",
  93. },
  94. "executable": False,
  95. "percentUnchanged": -1,
  96. "type": "MOVE",
  97. "nodeType": "FILE",
  98. "srcExecutable": False,
  99. "properties": {"gitChangeType": "MOVE"},
  100. },
  101. ]
  102. }
  103. REPO = {
  104. "slug": "helloworld",
  105. "id": 72,
  106. "name": "helloworld",
  107. "scmId": "git",
  108. "state": "AVAILABLE",
  109. "statusMessage": "Available",
  110. "forkable": True,
  111. "project": {
  112. "key": "laurynsentry",
  113. "id": 75,
  114. "name": "laurynsentry",
  115. "description": "",
  116. "public": False,
  117. "type": "Normal",
  118. "links": {"self": {"href": "https://bitbucket.example.org/projects/laurynsentry"}},
  119. },
  120. "public": False,
  121. "links": {
  122. "clone": {"href": "name"},
  123. "self": {
  124. "href": "https://bitbucket.example.org/projects/laurynsentry/repos/helloworld/browse"
  125. },
  126. },
  127. }
  128. COMPARE_COMMITS_WITH_PAGES_1_2_EXAMPLE = {
  129. "values": [
  130. {
  131. "id": "d0352305beb41afb3a4ea79e3a97bf6a97520339",
  132. "displayId": "d0352305beb",
  133. "author": {
  134. "name": "SentryU",
  135. "displayName": "Sentry User",
  136. "emailAddress": "sentryuser@getsentry.com",
  137. "type": "NORMAL",
  138. },
  139. "message": "Fist commit",
  140. "authorTimestamp": 1576763816000,
  141. }
  142. ],
  143. "size": 1,
  144. "isLastPage": False,
  145. "start": 0,
  146. "limit": 1,
  147. "nextPageStart": 1,
  148. }
  149. COMPARE_COMMITS_WITH_PAGES_2_2_EXAMPLE = {
  150. "values": [
  151. {
  152. "id": "042bc8434e0c178d8745c7d9f90bddab9c927887",
  153. "displayId": "042bc8434e0",
  154. "author": {
  155. "name": "SentryU",
  156. "displayName": "Sentry User",
  157. "emailAddress": "sentryuser@getsentry.com",
  158. "type": "NORMAL",
  159. },
  160. "message": "Second commit",
  161. "authorTimestamp": 1576763816000,
  162. }
  163. ],
  164. "size": 1,
  165. "isLastPage": True,
  166. "start": 1,
  167. "limit": 1,
  168. "nextPageStart": None,
  169. }
  170. COMMIT_CHANGELIST_WITH_PAGES_FIRST_COMMIT_EXAMPLE = {
  171. "values": [
  172. {
  173. "path": {
  174. "components": ["a.txt"],
  175. "parent": "",
  176. "name": "a.txt",
  177. "extension": "txt",
  178. "toString": "a.txt",
  179. },
  180. "executable": False,
  181. "percentUnchanged": -1,
  182. "type": "MODIFY",
  183. "nodeType": "FILE",
  184. "srcExecutable": False,
  185. "properties": {"gitChangeType": "MODIFY"},
  186. },
  187. {
  188. "path": {
  189. "components": ["b.txt"],
  190. "parent": "",
  191. "name": "b.txt",
  192. "extension": "txt",
  193. "toString": "b.txt",
  194. },
  195. "executable": False,
  196. "percentUnchanged": -1,
  197. "type": "ADD",
  198. "nodeType": "FILE",
  199. "srcExecutable": False,
  200. "properties": {"gitChangeType": "ADD"},
  201. },
  202. ]
  203. }
  204. COMMIT_CHANGELIST_WITH_PAGES_SECOND_COMMIT_EXAMPLE_1_2 = {
  205. "values": [
  206. {
  207. "path": {
  208. "components": ["c.txt"],
  209. "parent": "",
  210. "name": "c.txt",
  211. "extension": "txt",
  212. "toString": "c.txt",
  213. },
  214. "executable": False,
  215. "percentUnchanged": -1,
  216. "type": "DELETE",
  217. "nodeType": "FILE",
  218. "srcExecutable": False,
  219. "properties": {"gitChangeType": "DELETE"},
  220. }
  221. ],
  222. "size": 1,
  223. "isLastPage": False,
  224. "start": 0,
  225. "limit": 1,
  226. "nextPageStart": 1,
  227. }
  228. COMMIT_CHANGELIST_WITH_PAGES_SECOND_COMMIT_EXAMPLE_2_2 = {
  229. "values": [
  230. {
  231. "path": {
  232. "components": ["e.txt"],
  233. "parent": "",
  234. "name": "d.txt",
  235. "extension": "txt",
  236. "toString": "d.txt",
  237. },
  238. "srcPath": {
  239. "components": ["d.txt"],
  240. "parent": "",
  241. "name": "e.txt",
  242. "extension": "txt",
  243. "toString": "e.txt",
  244. },
  245. "executable": False,
  246. "percentUnchanged": -1,
  247. "type": "MOVE",
  248. "nodeType": "FILE",
  249. "srcExecutable": False,
  250. "properties": {"gitChangeType": "MOVE"},
  251. },
  252. ],
  253. "size": 1,
  254. "isLastPage": True,
  255. "start": 1,
  256. "limit": 1,
  257. "nextPageStart": None,
  258. }