1+ from qlty_check .src .utils import generate_random_id
2+
3+ def test_generate_random_id_happy_path ():
4+ """Test that generate_random_id produces a string of the correct length"""
5+ result = generate_random_id (10 )
6+ assert isinstance (result , str )
7+ assert len (result ) == 10
8+
9+ def test_generate_random_id_edge_cases ():
10+ """Test generate_random_id with edge case lengths"""
11+ # Test with length 0
12+ result = generate_random_id (0 )
13+ assert isinstance (result , str )
14+ assert len (result ) == 0
15+
16+ # Test with larger length
17+ result = generate_random_id (100 )
18+ assert isinstance (result , str )
19+ assert len (result ) == 100
20+
21+ def test_generate_random_id_different_outputs ():
22+ """Test that generate_random_id produces different outputs on subsequent calls"""
23+ result1 = generate_random_id (10 )
24+ result2 = generate_random_id (10 )
25+ assert result1 != result2
26+
27+ # Ensure both are valid strings of same length
28+ assert isinstance (result1 , str )
29+ assert isinstance (result2 , str )
30+ assert len (result1 ) == 10
31+ assert len (result2 ) == 10
0 commit comments