
    Cj2                    4   d Z ddlmZ ddlZddlmc mZ ddl	Z	ddl
Z
e	j                  j                  dd       ddlZddlmZ de
j                   d<    G d d	      Z G d
 d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Zy)u   Tests for v3.6 Harness — 6 rule coverage with ALLOW/DENY/HOLD_FOR_CHAIR fixtures.

chair_authorization_id=CHAIR-AUTH-TASK-2703-V36-HARNESS-MVP-260528

DoD: each of the 6 rules has ≥1 DENY or HOLD fixture, plus ALLOW baselines.
    )annotationsN/home/jay/workspace)evaluate1ANU_V36_HARNESS_TEST_MODEc                  $    e Zd Zd Zd Zd Zd Zy)TestRule1SessionBoundPollingc                    t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||u}|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z(tail -f waiting on .done file must DENY.Bashcommandz7tail -f /home/jay/workspace/memory/events/task-123.donedecisionDENY==z%(py1)s == %(py4)spy1py4assert %(py6)spy6Nmatched_rule$pattern.session_bound_direct_pollingreasonis notz%(py1)s is not %(py4)sr   
@pytest_ar_call_reprcompare	_safereprAssertionError_format_explanationselfd@py_assert0@py_assert3@py_assert2@py_format5@py_format7s          ;/home/jay/workspace/tests/harness/test_v36_harness_rules.pytest_tail_f_deniesz/TestRule1SessionBoundPolling.test_tail_f_denies   s	   Vi)bcegh}&&}&&&&}&&&}&&&&&&&&&& J$JJ $JJJJJ $JJJJ JJJ$JJJJJJJJ{&$&{$&&&&{$&&&{&&&$&&&&&&&    c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z3while ! -f .done; do sleep; done polling must DENY.zRwhile [ ! -f /home/jay/workspace/memory/events/task-2700.done ]; do sleep 30; doner   r   r   r   r   r   r   r   r   Nr   r   r   r$   cmdr%   r&   r'   r(   r)   r*   s           r+   #test_while_loop_done_polling_deniesz@TestRule1SessionBoundPolling.test_while_loop_done_polling_denies"   s    bVi-r2}&&}&&&&}&&&}&&&&&&&&&& J$JJ $JJJJJ $JJJJ JJJ$JJJJJJJJr-   c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z6python3 memory/task-timer.py status polling must DENY.zApython3 /home/jay/workspace/memory/task-timer.py status task-2703r   r   r   r   r   r   r   r   r   Nr   r   r   r/   s           r+   %test_task_timer_status_polling_denieszBTestRule1SessionBoundPolling.test_task_timer_status_polling_denies)   s    QVi-r2}&&}&&&&}&&&}&&&&&&&&&& J$JJ $JJJJJ $JJJJ JJJ$JJJJJJJJr-   c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z+while true; sleep; .done polling must DENY.z1while true; do sleep 60; cat task-2703.done; doner   r   r   r   r   r   r   r   r   Nr   r   r   r/   s           r+   !test_while_true_sleep_done_deniesz>TestRule1SessionBoundPolling.test_while_true_sleep_done_denies0   s    AVi-r2}&&}&&&&}&&&}&&&&&&&&&& J$JJ $JJJJJ $JJJJ JJJ$JJJJJJJJr-   N)__name__
__module____qualname__r,   r1   r3   r5    r-   r+   r	   r	      s    'KKKr-   r	   c                  $    e Zd Zd Zd Zd Zd Zy)TestRule2DirectCIWaitc                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgh run watch must DENY.r   r   zgh run watch 12345r   r   r   r   r   r   r   Nr   !pattern.anu_direct_ci_gemini_waitr   r#   s          r+   test_gh_run_watch_deniesz.TestRule2DirectCIWait.test_gh_run_watch_denies=   s    Vi)=>C}&&}&&&&}&&&}&&&&&&&&&& G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgh pr checks --watch must DENY.r   r   zgh pr checks 158 --watchr   r   r   r   r   r   r   Nr   r=   r   r#   s          r+   test_gh_pr_checks_watch_deniesz4TestRule2DirectCIWait.test_gh_pr_checks_watch_deniesC   s    Vi)CDbI}&&}&&&&}&&&}&&&&&&&&&& G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z$while loop polling gemini must DENY.z7while true; do python3 check_gemini.py; sleep 120; doner   r   r   r   r   r   r   r   r   Nr   r=   r   r/   s           r+   test_while_gemini_sleep_deniesz4TestRule2DirectCIWait.test_while_gemini_sleep_deniesI   s    GVi-r2}&&}&&&&}&&&}&&&&&&&&&& G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z while loop polling CI must DENY.z6while true; do gh run list; sleep 60; done  # ci checkr   r   r   r   r   r   r   r   r   Nr   r=   r   r/   s           r+   test_while_ci_sleep_deniesz0TestRule2DirectCIWait.test_while_ci_sleep_deniesP   s    FVi-r2}&&}&&&&}&&&}&&&&&&&&&& G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   N)r6   r7   r8   r>   r@   rB   rD   r9   r-   r+   r;   r;   <   s    HHHHr-   r;   c                  $    e Zd Zd Zd Zd Zd Zy)TestRule3MtimeSpeculationc                &   d}t        dd|di       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}|d   }d}||u}|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}y)z8Write to events/ with mtime content must HOLD_FOR_CHAIR.u?   Task completed (mtime) — all files modified at expected time.Write0/home/jay/workspace/memory/events/task-2703.done	file_pathcontentr   HOLD_FOR_CHAIRr   r   r   r   r   Nr   !pattern.mtime_speculation_as_factr   r   r   r   r$   rL   r%   r&   r'   r(   r)   r*   s           r+   "test_mtime_in_closeout_write_holdsz<TestRule3MtimeSpeculation.test_mtime_in_closeout_write_holds]   s   SLY`a

 }0 00} 00000} 0000}000 00000000 G$GG $GGGGG $GGGG GGG$GGGGGGGG{&$&{$&&&&{$&&&{&&&$&&&&&&&r-   c                (   d}t        dd|di       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}y)u3   Write .md with '추정 완료' must HOLD_FOR_CHAIR.uK   작업이 추정 완료됨. 파일들이 정상 배포된 것으로 보임.rH   z'/home/jay/workspace/docs/task-report.mdrJ   r   rM   r   r   r   r   r   Nr   rN   r   rO   s           r+   $test_estimation_complete_in_md_holdsz>TestRule3MtimeSpeculation.test_estimation_complete_in_md_holdsi   s    _CPWX

 }0 00} 00000} 0000}000 00000000 G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   c                (   d}t        dd|di       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}y)z5Write .md with 'likely complete' must HOLD_FOR_CHAIR.z5The task is likely complete based on file timestamps.rH   z%/home/jay/workspace/reports/status.mdrJ   r   rM   r   r   r   r   r   Nr   rN   r   rO   s           r+    test_likely_complete_in_md_holdsz:TestRule3MtimeSpeculation.test_likely_complete_in_md_holdst   s    IAgV

 }0 00} 00000} 0000}000 00000000 G$GG $GGGGG $GGGG GGG$GGGGGGGGr-   c                (   d}t        dd|di       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}y)z8Write .py with 'mtime' in non-report context must ALLOW.z)import os
mtime = os.path.getmtime(path)
rH   z$/home/jay/workspace/scripts/check.pyrJ   r   ALLOWr   r   r   r   r   Nr   rO   s           r+   &test_mtime_in_regular_code_file_allowsz@TestRule3MtimeSpeculation.test_mtime_in_regular_code_file_allows   so    ?@WU
 }''}''''}'''}''''''''''r-   N)r6   r7   r8   rP   rR   rT   rW   r9   r-   r+   rF   rF   \   s    
'	H	H	(r-   rF   c                      e Zd Zd Zd Zd Zy)TestRule4SelfStatusConfirmc                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z9touch on memory events .done without collector must DENY.z6touch /home/jay/workspace/memory/events/task-2703.doner   r   r   r   r   r   r   r   r   Nr   (pattern.self_status_confirm_no_collectorr   r/   s           r+   test_touch_memory_done_deniesz8TestRule4SelfStatusConfirm.test_touch_memory_done_denies   s    FVi-r2}&&}&&&&}&&&}&&&&&&&&&& N$NN $NNNNN $NNNN NNN$NNNNNNNNr-   c                $   t        ddddi       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            dx}x}}y)z=Write tool creating a .done file without collector must DENY.rH   rI   donerJ   r   r   r   r   r   r   r   Nr   r[   r   r#   s          r+   test_write_done_file_deniesz6TestRule4SelfStatusConfirm.test_write_done_file_denies   s    O! 
 }&&}&&&&}&&&}&&&&&&&&&& N$NN $NNNNN $NNNN NNN$NNNNNNNNr-   c                &   d}t        dd|ii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z8echo redirect to .done file without collector must DENY.zCecho 'completed' > /home/jay/workspace/memory/events/task-2703.doner   r   r   r   r   r   r   r   r   Nr   r[   r   r/   s           r+   test_echo_redirect_done_deniesz9TestRule4SelfStatusConfirm.test_echo_redirect_done_denies   s    SVi-r2}&&}&&&&}&&&}&&&&&&&&&& N$NN $NNNNN $NNNN NNN$NNNNNNNNr-   N)r6   r7   r8   r\   r_   ra   r9   r-   r+   rY   rY      s    OOOr-   rY   c                  0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestRule5ForbiddenToolc                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgit push origin main must DENY.r   r   zgit push origin mainr   r   r   r   r   r   r   Nr   pattern.forbidden_tool_or_shellr   r#   s          r+   test_git_push_main_deniesz0TestRule5ForbiddenTool.test_git_push_main_denies   s    Vi)?@"E}&&}&&&&}&&&}&&&&&&&&&& E$EE $EEEEE $EEEE EEE$EEEEEEEEr-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgit push --force must DENY.r   r   zgit push --force origin mainr   r   r   r   r   r   r   Nr   re   r   r#   s          r+   test_git_push_force_deniesz1TestRule5ForbiddenTool.test_git_push_force_denies       Vi)GH"M}&&}&&&&}&&&}&&&&&&&&&& E$EE $EEEEE $EEEE EEE$EEEEEEEEr-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)z'git push origin main --force must DENY.r   r   zgit push origin main --forcer   r   r   r   r   r   r   Nr   re   r   r#   s          r+   test_git_push_force_flag_deniesz6TestRule5ForbiddenTool.test_git_push_force_flag_denies   ri   r-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgh pr create must DENY.r   r   z,gh pr create --title 'Test PR' --body 'Test'r   r   r   r   r   r   r   Nr   re   r   r#   s          r+   test_gh_pr_create_deniesz/TestRule5ForbiddenTool.test_gh_pr_create_denies   s    Vi)WXZ\]}&&}&&&&}&&&}&&&&&&&&&& E$EE $EEEEE $EEEE EEE$EEEEEEEEr-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgh pr merge must DENY.r   r   zgh pr merge 158 --squashr   r   r   r   r   r   r   Nr   re   r   r#   s          r+   test_gh_pr_merge_deniesz.TestRule5ForbiddenTool.test_gh_pr_merge_denies   s    Vi)CDbI}&&}&&&&}&&&}&&&&&&&&&& E$EE $EEEEE $EEEE EEE$EEEEEEEEr-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            dx}x}}y)zgit reset --hard must DENY.r   r   zgit reset --hard origin/mainr   r   r   r   r   r   r   Nr   re   r   r#   s          r+   test_git_reset_hard_deniesz1TestRule5ForbiddenTool.test_git_reset_hard_denies   ri   r-   N)	r6   r7   r8   rf   rh   rk   rm   ro   rq   r9   r-   r+   rc   rc      s&    FFFFFFr-   rc   c                  $    e Zd Zd Zd Zd Zd Zy)TestRule6DoctrineOnlyc                *   ddd}t        dddi|      }|d   }d}||k(  }|slt        j                  d	|fd
||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d	|fd
||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}|d   }d}||u}|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}y)zLfinish-task.sh with new_code_files=0 and new_md_files=3 must HOLD_FOR_CHAIR.r      new_code_filesnew_md_filesr   r   9bash /home/jay/workspace/scripts/finish-task.sh task-2703r   rM   r   r   r   r   r   Nr   pattern.doctrine_only_no_coder   r   r   r   r$   contextr%   r&   r'   r(   r)   r*   s           r+   )test_finish_task_with_no_code_files_holdsz?TestRule6DoctrineOnly.test_finish_task_with_no_code_files_holds   s   %&:Vi)degno}0 00} 00000} 0000}000 00000000 C$CC $CCCCC $CCCC CCC$CCCCCCCC{&$&{$&&&&{$&&&{&&&$&&&&&&&r-   c                *   ddi}t        dddi|      }|d   }d}||k(  }|slt        j                  d|fd	||f      t        j                  |      t        j                  |      d
z  }dd|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d|fd	||f      t        j                  |      t        j                  |      d
z  }dd|iz  }t	        t        j
                  |            dx}x}}y)z;finish-task.sh with doctrine_only_flag must HOLD_FOR_CHAIR.doctrine_only_flagTr   r   zbash finish-task.sh task-2703r   rM   r   r   r   r   r   Nr   rz   r   r{   s           r+   )test_finish_task_with_doctrine_flag_holdsz?TestRule6DoctrineOnly.test_finish_task_with_doctrine_flag_holds   s    '.Vi)HI7S}0 00} 00000} 0000}000 00000000 C$CC $CCCCC $CCCC CCC$CCCCCCCCr-   c                ,   ddd}t        dddi|      }|d   }d}||k(  }|slt        j                  d	|fd
||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}y)z2finish-task.sh with new_code_files > 0 must ALLOW.      rv   r   r   ry   r   rV   r   r   r   r   r   Nr   r{   s           r+   'test_finish_task_with_code_files_allowsz=TestRule6DoctrineOnly.test_finish_task_with_code_files_allows   so    %&:Vi)degno}''}''''}'''}''''''''''r-   c                .   ddd}t        dddd|      }|d   }d	}||k(  }|slt        j                  d
|fd||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}|d   }d}||k(  }|slt        j                  d
|fd||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            dx}x}}y)zIWrite .md with no code files and finish_task_pending must HOLD_FOR_CHAIR.r   T)rw   finish_task_pendingrH   z&/home/jay/workspace/docs/prevention.mdu   재발 방지 계획rJ   r   rM   r   r   r   r   r   Nr   rz   r   r{   s           r+   *test_write_md_no_code_finish_pending_holdsz@TestRule6DoctrineOnly.test_write_md_no_code_finish_pending_holds   s    %&tDBOef

 }0 00} 00000} 0000}000 00000000 C$CC $CCCCC $CCCC CCC$CCCCCCCCr-   N)r6   r7   r8   r}   r   r   r   r9   r-   r+   rs   rs      s    'D(	Dr-   rs   c                  r    e Zd Zej                  j                  dg d      d        Zd Zd Zd Z	d Z
d Zy	)
TestNormalCommandAllowsr0   )zls -lazls /home/jay/workspacez2cat /home/jay/workspace/memory/events/task-2703.mdzpython3 -m pytest tests/ -vzpytest tests/harness/zpython3 -c "print(1)"z.grep -r 'pattern' /home/jay/workspace/scripts/z
git statuszgit log --oneline -10zgit diff HEAD~1zgh pr view 158zgh run view 12345zgit fetch originzgit remote -vc           
        t        dd|ii       }|d   }d}||k(  }|st        j                  d|fd||f      t        j                  |      t        j                  |      dz  }t        j                  d|d	|d   d
|j                  d      d      dz   d|iz  }t        t        j                  |            d x}x}}y )Nr   r   r   rV   r   r   r   zExpected ALLOW for z, got z (rule=r   )z
>assert %(py6)sr   )r   r   r   r    _format_assertmsggetr!   r"   r/   s           r+   test_safe_command_allowsz0TestNormalCommandAllows.test_safe_command_allows  s    " Vi-r2} 	
 	
}' 	
 	
} 	
 	
 
	  	
 	
 
	 !( 	
 	
  "#q}.? @UU>*-Q0	
 	
 	
 	
 	
 	
r-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            d x}x}}y )NReadrK   z0/home/jay/workspace/scripts/harness/v36/guard.pyr   rV   r   r   r   r   r   r   r#   s          r+   test_read_tool_allowsz-TestNormalCommandAllows.test_read_tool_allows  se    Vk+]^`bc}''}''''}'''}''''''''''r-   c                "   t        dddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }d	d
|iz  }t	        t        j
                  |            d x}x}}y )NGlobpatternz**/*.pyr   rV   r   r   r   r   r   r   r#   s          r+   test_glob_tool_allowsz-TestNormalCommandAllows.test_glob_tool_allows  sc    Vi3R8}''}''''}'''}''''''''''r-   c                $   t        ddddi       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      d	z  }d
d|iz  }t	        t        j
                  |            d x}x}}y )NGrepr   r   )r   pathr   rV   r   r   r   r   r   r   r#   s          r+   test_grep_tool_allowsz-TestNormalCommandAllows.test_grep_tool_allows   se    V=RSUWX}''}''''}'''}''''''''''r-   c                   t        di i       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }dd|iz  }t	        t        j
                  |            d x}x}}y )	Nr   r   rV   r   r   r   r   r   r   r#   s          r+   test_empty_input_allowsz/TestNormalCommandAllows.test_empty_input_allows$  s^    VR$}''}''''}'''}''''''''''r-   c                "   t        d ddii       }|d   }d}||k(  }|slt        j                  d|fd||f      t        j                  |      t        j                  |      dz  }dd	|iz  }t	        t        j
                  |            d x}x}}y )
Nr   lsr   rV   r   r   r   r   r   r   r#   s          r+   test_none_tool_name_allowsz2TestNormalCommandAllows.test_none_tool_name_allows(  sc    TIt,b1}''}''''}'''}''''''''''r-   N)r6   r7   r8   pytestmarkparametrizer   r   r   r   r   r   r9   r-   r+   r   r      sC    [[U %  
! 
(((((r-   r   )__doc__
__future__r   builtins@py_builtins_pytest.assertion.rewrite	assertionrewriter   sysosr   insertr   scripts.harness.v36.guardr   environr	   r;   rF   rY   rc   rs   r   r9   r-   r+   <module>r      s    #   
 	 ( )  . +.

& 'K KDH H@,( ,(fO OB#F #FTD DL*( *(r-   