Files
mistral-vibe/tests/core/test_slug.py
Mathias Gesbert eb580209d4 v2.6.0 (#524)
Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Gauthier Guinet <43207538+Gguinet@users.noreply.github.com>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Quentin <torroba.q@gmail.com>
Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: angelapopopo <angele.lenglemetz@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
2026-03-23 18:45:21 +01:00

35 lines
1.1 KiB
Python

from __future__ import annotations
from vibe.core.utils.slug import _ADJECTIVES, _NOUNS, create_slug
class TestCreateSlug:
def test_format_is_adj_adj_noun(self) -> None:
slug = create_slug()
parts = slug.split("-")
assert len(parts) == 3
def test_parts_from_word_pools(self) -> None:
slug = create_slug()
adj1, adj2, noun = slug.split("-")
assert adj1 in _ADJECTIVES
assert adj2 in _ADJECTIVES
assert noun in _NOUNS
def test_adjectives_are_distinct(self) -> None:
for _ in range(20):
adj1, adj2, _ = create_slug().split("-")
assert adj1 != adj2
def test_randomness_produces_variety(self) -> None:
slugs = {create_slug() for _ in range(20)}
assert len(slugs) > 1
def test_word_pools_non_empty(self) -> None:
assert len(_ADJECTIVES) > 0
assert len(_NOUNS) > 0
def test_word_pools_have_no_duplicates(self) -> None:
assert len(_ADJECTIVES) == len(set(_ADJECTIVES))
assert len(_NOUNS) == len(set(_NOUNS))