v2.4.0 (#470)
Co-authored-by: Quentin Torroba <quentin.torroba@mistral.ai> Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai> Co-authored-by: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-authored-by: Clement Sirieix <clem.sirieix@gmail.com> Co-authored-by: Antoine W <antoine.wronka@mistral.ai> Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
5d2e01a6d7
commit
dd372ce494
89 changed files with 2086 additions and 596 deletions
34
tests/core/test_slug.py
Normal file
34
tests/core/test_slug.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from vibe.core.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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue