Пример #1
0
def convert(issues: list, comments: List[GitbucketComment],
            idConverter: IdConverter) -> dict:
    """
    Bitbucketにインポートできる形式に変換します
    """
    return {
        'issues':
        [issue_converter.convert(issue, idConverter) for issue in issues],
        'comments': [
            comment_converter.convert(comment, idConverter)
            for comment in comments
        ],
        'attachments': [],
        'logs': [],  # これはGitbucketのAPIからは取得できないので空
        'meta': {
            'default_assignee': None,
            'default_component': None,
            'default_kind': 'task',  # これは引数で設定できるようにしたい
            'default_milestone': None,
            'default_version': None,
        },
        'components': [],
        'milestones': [],
        'versions': [],
    }
Пример #2
0
def test_convert_ClosedIssue(emptyIdConverter, gitbucketClosedIssue,
                             bitbucketClosedIssue):
    actual = convert(gitbucketClosedIssue, emptyIdConverter)
    assert actual == bitbucketClosedIssue
Пример #3
0
def test_convert_WontfixIssue(emptyIdConverter, gitbucketWontfixIssue,
                              bitbucketWontfixIssue):
    actual = convert(gitbucketWontfixIssue, emptyIdConverter)
    assert actual == bitbucketWontfixIssue
Пример #4
0
def test_convert_DuplicatedIssue(emptyIdConverter, gitbucketDuplicatedIssue,
                                 bitbucketDuplicatedIssue):
    actual = convert(gitbucketDuplicatedIssue, emptyIdConverter)
    assert actual == bitbucketDuplicatedIssue
Пример #5
0
def test_convert_InvalidIssue(emptyIdConverter, gitbucketInvalidIssue,
                              bitbucketInvalidIssue):
    actual = convert(gitbucketInvalidIssue, emptyIdConverter)
    assert actual == bitbucketInvalidIssue
Пример #6
0
def test_convert_proposalIssue(emptyIdConverter, gitbucketProposalIssue,
                               bitbucketProposalIssue):
    actual = convert(gitbucketProposalIssue, emptyIdConverter)
    assert actual == bitbucketProposalIssue
Пример #7
0
def test_convert_enhancementIssue(emptyIdConverter, gitbucketEnhancementIssue,
                                  bitbucketEnhancementIssue):
    actual = convert(gitbucketEnhancementIssue, emptyIdConverter)
    assert actual == bitbucketEnhancementIssue
Пример #8
0
def test_convert_bugIssue(emptyIdConverter, gitbucketBugIssue,
                          bitbucketBugIssue):
    actual = convert(gitbucketBugIssue, emptyIdConverter)
    assert actual == bitbucketBugIssue
Пример #9
0
def test_convert_normalIssue(emptyIdConverter, gitbucketIssue, bitbucketIssue):
    actual = convert(gitbucketIssue, emptyIdConverter)
    assert actual == bitbucketIssue