kubernetes.aio.config.dateutil_test module

class kubernetes.aio.config.dateutil_test.DateUtilTest(methodName='runTest')

Bases: TestCase

test_format_rfc3339()
test_parse_rfc3339()
test_parse_rfc3339_error_message_clarity()

Test that error messages are clear and helpful

test_parse_rfc3339_handles_none_from_timezone_regex()

Test parse_rfc3339 handles timezone regex returning None.

This test addresses the GitHub issue where parse_rfc3339 was calling .groups() on None when the timezone regex failed to match, causing: ‘NoneType’ object has no attribute ‘groups’

The fix adds a check to ensure _re_timezone.search() result is not None before calling .groups(), and provides a clear error message.

test_parse_rfc3339_invalid_formats()

Test that invalid RFC3339 formats raise ValueError

test_parse_rfc3339_with_whitespace()

Test that leading/trailing whitespace is handled