Example #1
0
def test_basic_style_fix():
    subject = "Fixed a bug"
    commit = Commit(hash="aaaaaaa",
                    subject=subject,
                    author_date="1574340645",
                    committer_date="1574340645")
    style = BasicStyle()
    commit_dict = style.parse_commit(commit)
    assert not commit_dict["is_major"]
    assert not commit_dict["is_minor"]
    assert commit_dict["is_patch"]
def test_angular_style_fix():
    subject = "fix: this is a bug fix"
    commit = Commit(hash="aaaaaaa",
                    subject=subject,
                    author_date="1574340645",
                    committer_date="1574340645")
    style = AngularStyle()
    commit_dict = style.parse_commit(commit)
    assert not commit_dict["is_major"]
    assert not commit_dict["is_minor"]
    assert commit_dict["is_patch"]
Example #3
0
def test_basic_style_breaking_change():
    subject = "Added a new breaking feature"
    body = ["BREAKING CHANGE: there is a breaking feature in this code"]
    commit = Commit(hash="aaaaaaa",
                    subject=subject,
                    body=body,
                    author_date="1574340645",
                    committer_date="1574340645")
    style = BasicStyle()
    commit_dict = style.parse_commit(commit)
    assert commit_dict["is_major"]
    assert not commit_dict["is_minor"]
    assert not commit_dict["is_patch"]