File: test_script.py

package info (click to toggle)
babelfish 0.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 416 kB
  • sloc: python: 707; makefile: 5; sh: 4
file content (21 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import pickle
import pytest
from babelfish.script import Script


def test_wrong_script():
    with pytest.raises(ValueError):
        Script("Qwerty")

def test_eq():
    assert Script("Latn") == Script("Latn")

def test_ne():
    assert Script("Cyrl") != Script("Latn")

def test_hash_eq():
    assert hash(Script("Hira")) == hash(Script("Hira"))

def test_pickle():
    assert pickle.loads(pickle.dumps(Script("Latn"))) == Script("Latn")