コード例 #1
0
ファイル: test_util.py プロジェクト: rscohn2/reuse-tool
def test_make_copyright_line_existing_other_copyright():
    """Given a non-SPDX copyright line, do nothing."""
    value = "© hello"
    assert _util.make_copyright_line(value) == value
コード例 #2
0
ファイル: test_util.py プロジェクト: rscohn2/reuse-tool
def test_make_copyright_line_multine_error():
    """Given a multiline arguement, expect an error."""
    with pytest.raises(RuntimeError):
        _util.make_copyright_line("hello\nworld")
コード例 #3
0
ファイル: test_util.py プロジェクト: rscohn2/reuse-tool
def test_make_copyright_line_year():
    """Given a simple statement and a year, make it a copyright line."""
    assert (
        _util.make_copyright_line("hello", year="2019") == "SPDX"
        "-FileCopyrightText: 2019 hello"
    )
コード例 #4
0
ファイル: test_util.py プロジェクト: rscohn2/reuse-tool
def test_make_copyright_line_existing_spdx_copyright():
    """Given a copyright line, do nothing."""
    value = "SPDX" "-FileCopyrightText: hello"
    assert _util.make_copyright_line(value) == value
コード例 #5
0
ファイル: test_util.py プロジェクト: rscohn2/reuse-tool
def test_make_copyright_line_simple():
    """Given a simple statement, make it a copyright line."""
    assert (
        _util.make_copyright_line("hello") == "SPDX"
        "-FileCopyrightText: hello"
    )
コード例 #6
0
ファイル: test_util.py プロジェクト: fsfe/reuse-tool
def test_make_copyright_line_style_symbol_year():
    """Given a simple statement, style and a year, make it a copyright line."""
    statement = _util.make_copyright_line("hello",
                                          year=2019,
                                          copyright_style="symbol")
    assert statement == "© 2019 hello"
コード例 #7
0
ファイル: test_util.py プロジェクト: fsfe/reuse-tool
def test_make_copyright_line_style_string_c_year():
    """Given a simple statement, style and a year, make it a copyright line."""
    statement = _util.make_copyright_line("hello",
                                          year=2019,
                                          copyright_style="string-c")
    assert statement == "Copyright (C) 2019 hello"
コード例 #8
0
ファイル: test_util.py プロジェクト: fsfe/reuse-tool
def test_make_copyright_line_style_spdx_year():
    """Given a simple statement, style and a year, make it a copyright line."""
    statement = _util.make_copyright_line("hello",
                                          year=2019,
                                          copyright_style="spdx")
    assert statement == "SPDX-FileCopyrightText: 2019 hello"
コード例 #9
0
ファイル: test_util.py プロジェクト: fsfe/reuse-tool
def test_make_copyright_line_style_spdx():
    """Given a simple statement and style, make it a copyright line."""
    statement = _util.make_copyright_line("hello", copyright_style="spdx")
    assert statement == "SPDX-FileCopyrightText: hello"