slinky/tests/test_slinky.py

17 lines
497 B
Python
Raw Normal View History

2021-12-19 11:48:42 +00:00
from unittest import TestCase
import slinky
class TestSlinky(TestCase):
def test_random_string(self) -> None:
"""
Ensure the random string generates correctly
"""
self.assertEqual(4, len(slinky.random_string()))
self.assertEqual(8, len(slinky.random_string(8)))
self.assertEqual(16, len(slinky.random_string(16)))
self.assertEqual(64, len(slinky.random_string(64)))
self.assertTrue(slinky.random_string(128).isalnum(), True)