File: test_typeerror-274.py

package info (click to toggle)
python-semver 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 700 kB
  • sloc: python: 1,972; makefile: 28
file content (14 lines) | stat: -rw-r--r-- 341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest
import semver


def test_should_work_with_string_and_bytes():
    result = semver.compare("1.1.0", b"1.2.2")
    assert result == -1
    result = semver.compare(b"1.1.0", "1.2.2")
    assert result == -1


def test_should_not_work_with_invalid_args():
    with pytest.raises(TypeError):
        semver.version.Version.parse(8)