Ë
    ó·?iÖ  ã                   ó„   — d Z ddlmZ ddlmZmZmZmZ  G d„ de«      Z G d„ de«      Z	 G d„ d	e«      Z
 G d
„ de«      Zy)z,
Tests for django_cronjob_utils exceptions.
é    )ÚTestCase)ÚCronJobErrorÚTaskNotFoundErrorÚConcurrentExecutionErrorÚValidationErrorc                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚCronJobErrorTestsz&Tests for CronJobError base exception.c                 ó¨   — | j                  t        «      5 }t        d«      ‚# 1 sw Y   nxY w| j                  t        j                  «      d«       y)z Test CronJobError can be raised.z
Test errorN)ÚassertRaisesr   ÚassertEqualÚstrÚ	exception©ÚselfÚcms     úE/home/cursorai/projects/django-cronjob-utils/tests/test_exceptions.pyÚtest_cron_job_errorz%CronJobErrorTests.test_cron_job_error   sA   € à×Ñœ|Ô,°Ü˜|Ó,Ð,÷ -Ð,úð 	×Ñœ˜RŸ\™\Ó*¨LÕ9ó   –"¢+c                 óJ   — | j                  t        t        t        «      «       y)z"Test CronJobError is an Exception.N)Ú
assertTrueÚ
issubclassr   Ú	Exception©r   s    r   Útest_cron_job_error_inheritancez1CronJobErrorTests.test_cron_job_error_inheritance   s   € à�‰œ
¤<´Ó;Õ<ó    c                 óZ   — | j                  t        «      5  t        «       ‚# 1 sw Y   yxY w)z"Test CronJobError without message.N)r   r   r   s    r   Útest_cron_job_error_no_messagez0CronJobErrorTests.test_cron_job_error_no_message   s!   € à×Ñœ|Õ,Ü“.Ð ÷ -Ð,ús   –!¡*N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   © r   r   r	   r	      s   „ Ù0ò:ò=ó!r   r	   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚTaskNotFoundErrorTestszTests for TaskNotFoundError.c                 ó¨   — | j                  t        «      5 }t        d«      ‚# 1 sw Y   nxY w| j                  t        j                  «      d«       y)z$Test TaskNotFoundError with message.zTask 'test-task' not foundN©r   r   r   r   r   r   s     r   Útest_task_not_found_errorz0TaskNotFoundErrorTests.test_task_not_found_error$   sD   € à×ÑÔ0Ô1°RÜ#Ð$@ÓAÐA÷ 2Ð1úð 	×Ñœ˜RŸ\™\Ó*Ð,HÕIr   c                 óJ   — | j                  t        t        t        «      «       y)z2Test TaskNotFoundError inherits from CronJobError.N)r   r   r   r   r   s    r   Ú%test_task_not_found_error_inheritancez<TaskNotFoundErrorTests.test_task_not_found_error_inheritance+   s   € à�‰œ
Ô#4´lÓCÕDr   c                 ó¨   — | j                  t        «      5 }t        d«      ‚# 1 sw Y   nxY w| j                  t        j                  «      d«       y)z*Test TaskNotFoundError with empty message.Ú Nr&   r   s     r   Ú'test_task_not_found_error_empty_messagez>TaskNotFoundErrorTests.test_task_not_found_error_empty_message/   sB   € à×ÑÔ0Ô1°RÜ# BÓ'Ð'÷ 2Ð1úð 	×Ñœ˜RŸ\™\Ó*¨BÕ/r   N)r   r   r    r!   r'   r)   r,   r"   r   r   r$   r$   !   s   „ Ù&òJòEó0r   r$   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚConcurrentExecutionErrorTestsz#Tests for ConcurrentExecutionError.c                 ó¨   — | j                  t        «      5 }t        d«      ‚# 1 sw Y   nxY w| j                  t        j                  «      d«       y)z+Test ConcurrentExecutionError with message.zTask already runningN)r   r   r   r   r   r   s     r   Útest_concurrent_execution_errorz=ConcurrentExecutionErrorTests.test_concurrent_execution_error:   sD   € à×ÑÔ7Ô8¸BÜ*Ð+AÓBÐB÷ 9Ð8úð 	×Ñœ˜RŸ\™\Ó*Ð,BÕCr   c                 óJ   — | j                  t        t        t        «      «       y)z9Test ConcurrentExecutionError inherits from CronJobError.N)r   r   r   r   r   s    r   Ú+test_concurrent_execution_error_inheritancezIConcurrentExecutionErrorTests.test_concurrent_execution_error_inheritanceA   s   € à�‰œ
Ô#;¼\ÓJÕKr   c                 óö   — d}| j                  t        «      5 }t        |«      ‚# 1 sw Y   nxY w| j                  dt        j                  «      «       | j                  dt        |j                  «      «       y)z4Test ConcurrentExecutionError with detailed message.zITask A001 already running for 2024-01-15 (started at 2024-01-15 10:00:00)NÚA001z
2024-01-15)r   r   ÚassertInr   r   ©r   Úmessager   s      r   Ú0test_concurrent_execution_error_detailed_messagezNConcurrentExecutionErrorTests.test_concurrent_execution_error_detailed_messageE   s\   € à]ˆØ×ÑÔ7Ô8¸BÜ*¨7Ó3Ð3÷ 9Ð8úð 	�‰�fœc "§,¡,Ó/Ô0Ø�‰�l¤C¨¯©Ó$5Õ6ó   ˜$¤-N)r   r   r    r!   r0   r2   r8   r"   r   r   r.   r.   7   s   „ Ù-òDòLó7r   r.   c                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚValidationErrorTestszTests for ValidationError.c                 ó¨   — | j                  t        «      5 }t        d«      ‚# 1 sw Y   nxY w| j                  t        j                  «      d«       y)z"Test ValidationError with message.zInvalid execution_dateN)r   r   r   r   r   r   s     r   Útest_validation_errorz*ValidationErrorTests.test_validation_errorR   sC   € à×ÑœÔ/°2Ü!Ð":Ó;Ð;÷ 0Ð/úð 	×Ñœ˜RŸ\™\Ó*Ð,DÕEr   c                 óJ   — | j                  t        t        t        «      «       y)z0Test ValidationError inherits from CronJobError.N)r   r   r   r   r   s    r   Ú!test_validation_error_inheritancez6ValidationErrorTests.test_validation_error_inheritanceY   s   € à�‰œ
¤?´LÓAÕBr   c                 óö   — d}| j                  t        «      5 }t        |«      ‚# 1 sw Y   nxY w| j                  dt        j                  «      «       | j                  dt        |j                  «      «       y)z1Test ValidationError with field-specific message.z7execution_date must be a date object, got <class 'str'>NÚexecution_datezdate object)r   r   r5   r   r   r6   s      r   Ú$test_validation_error_field_specificz9ValidationErrorTests.test_validation_error_field_specific]   s\   € àKˆØ×ÑœÔ/°2Ü! 'Ó*Ð*÷ 0Ð/úð 	�‰Ð&¬¨B¯L©LÓ(9Ô:Ø�‰�m¤S¨¯©Ó%6Õ7r9   N)r   r   r    r!   r=   r?   rB   r"   r   r   r;   r;   O   s   „ Ù$òFòCó8r   r;   N)r!   Údjango.testr   Údjango_cronjob_utils.exceptionsr   r   r   r   r	   r$   r.   r;   r"   r   r   Ú<module>rE      sI   ðñõ !÷ó ô!˜ô !ô(0˜Xô 0ô,7 Hô 7ô08˜8õ 8r   