add mod_floor() and mod_ceil(), fix b64*() taking a wrong turn

This commit is contained in:
Yusur 2025-07-19 23:09:16 +02:00
parent 8a16fe159f
commit 3188b59c15
7 changed files with 86 additions and 18 deletions

View file

@ -4,6 +4,7 @@
import unittest
from suou.strtools import PrefixIdentifier
from pydantic import ValidationError
class TestStrtools(unittest.TestCase):
def setUp(self) -> None:
@ -19,12 +20,12 @@ class TestStrtools(unittest.TestCase):
self.assertEqual(pi['\x1b\x00'], '\x1b\0')
self.assertEqual(pi.same_thing, pi['same_thing'])
with self.assertRaises(TypeError):
with self.assertRaises(ValidationError):
pi[0]
self.assertEqual(PrefixIdentifier(None), PrefixIdentifier(''))
self.assertEqual(f'{PrefixIdentifier(None)}', f'{PrefixIdentifier("")}')
def test_PrefixIdentifier_invalid(self):
def test_PrefixIdentifier_get_nostr(self):
with self.assertRaises(TypeError):
pi = PrefixIdentifier(1)
pi.hello
@ -35,4 +36,5 @@ class TestStrtools(unittest.TestCase):
with self.assertRaises(TypeError):
PrefixIdentifier(b'alpha_')