o
    il                     @   s   d dl mZ d dlZd dlmZ d dlmZ ddlmZ e Z	ej
dejfdd	Zej
dejfd
dZej
d	efddZej
ddd	efddZejje  ddd	edefddZdS )    )PathN)	CliRunner)app   )has_gittmp_path_factoryc                 C      |  d}|d S )Nprojectmktempr   base r   P/home/ubuntu/.local/lib/python3.10/site-packages/weasel/tests/cli/test_remote.pyproject_dir      
r   c                 C   r   )Nremoter
   r   r   r   r   
remote_url   r   r   c                 C   sH   d}d}t tdd|d|dt| g}|jdksJ | d  s"J d	S )
zCloning shouldn't failz#https://github.com/explosion/weaselmainclonez--repoz--branchzweasel/tests/demo_projectr   project.ymlN)runnerinvoker   str	exit_codeexists)r   repobranchresultr   r   r   r      s   r   T)autousec                 C   s@   t tdt|g}t|j |jdksJ |d  sJ d S )Nassetsr   assets/README.md)r   r   r   r   printstdoutr   r   )r   r   r   r   r   r   r    1   s   
r    zgit not installed)reasonc                 C   s   t tdt| g}|jdksJ | d  sJ t tddt| g}|jdks+J t| d d}|d| d	 W d    n1 sFw   Y  t td
dt| g}|jdks]J | d   t tddt| g}|jdksuJ | d  s}J d S )Nr    r   r!   runprepr   az
remotes:
    default: 
pushdefaultzcorpus/stuff.txtpull)	r   r   r   r   r   r   openwriteunlink)r   r   r   project_filer   r   r   test_remote:   s   r0   )pathlibr   pytesttyper.testingr   weaselr   test_cli_appr   r   fixtureTempPathFactoryr   r   r   r    markskipifr0   r   r   r   r   <module>   s     
