File: test_rustobj.py

package info (click to toggle)
sourmash 4.9.4-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,688 kB
  • sloc: python: 59,380; ansic: 332; makefile: 277; sh: 6
file content (18 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

from sourmash.utils import RustObject
from sourmash.minhash import to_bytes


def test_rustobj_init():
    with pytest.raises(TypeError):
        RustObject()


def test_to_bytes():
    with pytest.raises(TypeError):
        to_bytes([9882])

    assert to_bytes(98) == bytes([98])
    assert to_bytes("abc") == b"abc"
    assert to_bytes(b"abc") == b"abc"