e52ddb7dd4
CodeQL / Analyze (python) (push) Failing after 1s
Linting and testing / build (3.11) (push) Failing after 0s
Package exe with PyInstaller - Windows / build (push) Failing after 2s
Linting and testing / build (3.10) (push) Failing after 1s
Linting and testing / minimal-install (push) Failing after 1s
Update sites rating and statistics / build (push) Failing after 1s
Build docker image and push to DockerHub / docker (push) Failing after 1s
Linting and testing / build (3.12) (push) Failing after 1s
Linting and testing / build (3.14) (push) Failing after 1s
Linting and testing / build (3.13) (push) Failing after 2s
51 lines
955 B
Python
51 lines
955 B
Python
import pytest
|
|
from maigret.permutator import Permute
|
|
|
|
|
|
def test_gather_strict():
|
|
elements = {'a': 1, 'b': 2}
|
|
permute = Permute(elements)
|
|
result = permute.gather(method="strict")
|
|
expected = {
|
|
'a_b': 1,
|
|
'b_a': 2,
|
|
'a-b': 1,
|
|
'b-a': 2,
|
|
'a.b': 1,
|
|
'b.a': 2,
|
|
'ab': 1,
|
|
'ba': 2,
|
|
'_ab': 1,
|
|
'ab_': 1,
|
|
'_ba': 2,
|
|
'ba_': 2,
|
|
}
|
|
assert result == expected
|
|
|
|
|
|
def test_gather_all():
|
|
elements = {'a': 1, 'b': 2}
|
|
permute = Permute(elements)
|
|
result = permute.gather(method="all")
|
|
expected = {
|
|
'a': 1,
|
|
'_a': 1,
|
|
'a_': 1,
|
|
'b': 2,
|
|
'_b': 2,
|
|
'b_': 2,
|
|
'a_b': 1,
|
|
'b_a': 2,
|
|
'a-b': 1,
|
|
'b-a': 2,
|
|
'a.b': 1,
|
|
'b.a': 2,
|
|
'ab': 1,
|
|
'ba': 2,
|
|
'_ab': 1,
|
|
'ab_': 1,
|
|
'_ba': 2,
|
|
'ba_': 2,
|
|
}
|
|
assert result == expected
|