File: test_scripts.py

package info (click to toggle)
normality 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 180 kB
  • sloc: python: 1,275; makefile: 17
file content (18 lines) | stat: -rw-r--r-- 671 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from normality.scripts import ALPHABET, CYRILLIC, CJK
from normality.scripts import char_tags, is_modern_alphabet


def test_char_tags():
    assert ALPHABET in char_tags("a")
    assert CYRILLIC not in char_tags("a")
    assert CYRILLIC in char_tags("д")
    assert CJK in char_tags("近")
    assert ALPHABET not in char_tags("近")


def test_is_modern_alphabet():
    assert not is_modern_alphabet(" 习近平")
    assert is_modern_alphabet("Xí Jìnpíng")
    assert is_modern_alphabet("Ротенберг Аркадий")
    assert is_modern_alphabet(".,[]{}()!@#$%^&*()_+)«»‘“")
    assert not is_modern_alphabet("တပ်မတော်(ကြည်")