dnd-npcs/test/test_languages.py
evilchili 2e5b5556a3 Refactor out langauges
This commmit removes the languages code and takes a dependency on the
rewritten module.
2023-11-22 12:18:50 -05:00

21 lines
537 B
Python

import pytest
from language.types import WeightedSet
from language.languages.common import common
@pytest.mark.parametrize('values,expected_members,expected_weights', [
((('foo', 1.0), ('bar', 0.5)), ('foo', 'bar'), (1.0, 0.5))
])
def test_WeightedSet(values, expected_members, expected_weights):
print(*values)
ws = WeightedSet(*values)
assert ws.members == expected_members
assert ws.weights == expected_weights
assert ws.random()
def test_common():
for i in range(50000):
assert common.word()