123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- from collections import OrderedDict
- EXAMPLE_PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY-----
- MIICWwIBAAKBgQC1cd9t8sA03awggLiX2gjZxyvOVUPJksLly1E662tttTeR3Wm9
- eo6onNeI8HRD+O4wubUp4h4Chc7DtLDmFEPhUZ8Qkwztiifm99Xo3s0nUq4Pygp5
- AU09KXTEPbzHLh1dnXLcxVLmGDE4drh0NWmYsd/Zp7XNIZq2TRQQ3NTdVQIDAQAB
- AoGAFwMyS0eWiR30TssEnn3Q0Y4pSCoYRuCOR4bZ7pcdMPTi72UdnCKHJWt/Cqc0
- l8piq1tiVsWO+NLvvnKUXRoE4cAyrGrpf1F0uP5zYW71SQALc9wwsjDzuj7BZEuK
- fg35JSceLHWE1WtzPDX5Xg20YPnMrA/xe/RwuPjuBH0wSqECQQDizzmKdKCq0ejy
- 3OxEto5knqpSEgRcOk0HDsdgjwkwiZJOj5ECV2FKpNHuu2thGy/aDJyLlmUso8j0
- OpvLAzOvAkEAzMwAgGexTxKm8hy3ilvVn9EvhSKjaIakqY4ONK9LZ4zMiDHI0H6C
- FXlwWX7CJM0YVFMubj8SB8rnIuvFDEBMOwJABHtRyMGbNyTktH/XD1iIIcbc2LhQ
- a74fLYeGOws4hEQDpxfBJsmxO3dcSppbedS+slFTepKjNymZW/IYh/9tMwJAEL5E
- 9DqGBn7x4y1x2//yESTbC7lvPqZzY+FXS/tg4NBkEGZxkoolPHg3NTnlyXhzGsHK
- M/04DicKipJYA85l7QJAJ3u67qZXecM/oWTtJToBDuyKGHfdY1564+RbyDEjJJRb
- vz4O/8FQQ1sGjdEBMMrRBCHEG8o3/XDTrB97t45TeA==
- -----END RSA PRIVATE KEY-----"""
- COMPARE_COMMITS_EXAMPLE = {
- "values": [
- {
- "id": "e18e4e72de0d824edfbe0d73efe34cbd0d01d301",
- "displayId": "e18e4e72de0",
- "author": {
- "name": "SentryU",
- "displayName": "Sentry User",
- "emailAddress": "sentryuser@getsentry.com",
- "type": "NORMAL",
- },
- "message": "README.md edited online with Bitbucket",
- "authorTimestamp": 1576763816000,
- }
- ]
- }
- COMMIT_CHANGELIST_EXAMPLE = {
- "values": [
- {
- "path": {
- "components": ["a.txt"],
- "parent": "",
- "name": "a.txt",
- "extension": "txt",
- "toString": "a.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "MODIFY",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "MODIFY"},
- },
- {
- "path": {
- "components": ["b.txt"],
- "parent": "",
- "name": "b.txt",
- "extension": "txt",
- "toString": "b.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "ADD",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "ADD"},
- },
- {
- "path": {
- "components": ["c.txt"],
- "parent": "",
- "name": "c.txt",
- "extension": "txt",
- "toString": "c.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "DELETE",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "DELETE"},
- },
- {
- "path": {
- "components": ["e.txt"],
- "parent": "",
- "name": "d.txt",
- "extension": "txt",
- "toString": "d.txt",
- },
- "srcPath": {
- "components": ["d.txt"],
- "parent": "",
- "name": "e.txt",
- "extension": "txt",
- "toString": "e.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "MOVE",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "MOVE"},
- },
- ]
- }
- REPO = {
- "slug": "helloworld",
- "id": 72,
- "name": "helloworld",
- "scmId": "git",
- "state": "AVAILABLE",
- "statusMessage": "Available",
- "forkable": True,
- "project": OrderedDict(
- [
- ("key", "laurynsentry"),
- ("id", 75),
- ("name", "laurynsentry"),
- ("description", ""),
- ("public", False),
- ("type", "Normal"),
- (
- "links",
- OrderedDict(
- [
- (
- "self",
- OrderedDict(
- [("href", "https://bitbucket.example.org/projects/laurynsentry")]
- ),
- )
- ]
- ),
- ),
- ]
- ),
- "public": False,
- "links": OrderedDict(
- [
- (
- "clone",
- OrderedDict(
- [
- OrderedDict(
- [
- (
- "href",
- "https://bitbucket.example.org/scm/laurynsentry/helloworld.git",
- ),
- ("name", "http"),
- ]
- ),
- OrderedDict(
- [
- (
- "href",
- "ssh://git@bitbucket.example.org:7999/laurynsentry/helloworld.git",
- ),
- ("name", "ssh"),
- ]
- ),
- ]
- ),
- ),
- (
- "self",
- OrderedDict(
- [
- (
- "href",
- "https://bitbucket.example.org/projects/laurynsentry/repos/helloworld/browse",
- )
- ]
- ),
- ),
- ]
- ),
- }
- COMPARE_COMMITS_WITH_PAGES_1_2_EXAMPLE = {
- "values": [
- {
- "id": "d0352305beb41afb3a4ea79e3a97bf6a97520339",
- "displayId": "d0352305beb",
- "author": {
- "name": "SentryU",
- "displayName": "Sentry User",
- "emailAddress": "sentryuser@getsentry.com",
- "type": "NORMAL",
- },
- "message": "Fist commit",
- "authorTimestamp": 1576763816000,
- }
- ],
- "size": 1,
- "isLastPage": False,
- "start": 0,
- "limit": 1,
- "nextPageStart": 1,
- }
- COMPARE_COMMITS_WITH_PAGES_2_2_EXAMPLE = {
- "values": [
- {
- "id": "042bc8434e0c178d8745c7d9f90bddab9c927887",
- "displayId": "042bc8434e0",
- "author": {
- "name": "SentryU",
- "displayName": "Sentry User",
- "emailAddress": "sentryuser@getsentry.com",
- "type": "NORMAL",
- },
- "message": "Second commit",
- "authorTimestamp": 1576763816000,
- }
- ],
- "size": 1,
- "isLastPage": True,
- "start": 1,
- "limit": 1,
- "nextPageStart": None,
- }
- COMMIT_CHANGELIST_WITH_PAGES_FIRST_COMMIT_EXAMPLE = {
- "values": [
- {
- "path": {
- "components": ["a.txt"],
- "parent": "",
- "name": "a.txt",
- "extension": "txt",
- "toString": "a.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "MODIFY",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "MODIFY"},
- },
- {
- "path": {
- "components": ["b.txt"],
- "parent": "",
- "name": "b.txt",
- "extension": "txt",
- "toString": "b.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "ADD",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "ADD"},
- },
- ]
- }
- COMMIT_CHANGELIST_WITH_PAGES_SECOND_COMMIT_EXAMPLE_1_2 = {
- "values": [
- {
- "path": {
- "components": ["c.txt"],
- "parent": "",
- "name": "c.txt",
- "extension": "txt",
- "toString": "c.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "DELETE",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "DELETE"},
- }
- ],
- "size": 1,
- "isLastPage": False,
- "start": 0,
- "limit": 1,
- "nextPageStart": 1,
- }
- COMMIT_CHANGELIST_WITH_PAGES_SECOND_COMMIT_EXAMPLE_2_2 = {
- "values": [
- {
- "path": {
- "components": ["e.txt"],
- "parent": "",
- "name": "d.txt",
- "extension": "txt",
- "toString": "d.txt",
- },
- "srcPath": {
- "components": ["d.txt"],
- "parent": "",
- "name": "e.txt",
- "extension": "txt",
- "toString": "e.txt",
- },
- "executable": False,
- "percentUnchanged": -1,
- "type": "MOVE",
- "nodeType": "FILE",
- "srcExecutable": False,
- "properties": {"gitChangeType": "MOVE"},
- },
- ],
- "size": 1,
- "isLastPage": True,
- "start": 1,
- "limit": 1,
- "nextPageStart": None,
- }
|