B
    u9a              	   @   s   d dl mZ d dlZd dlZe  edde d dlZW dQ R X G dd dejZ	G dd dej
ejZed	kr~e  dS )
    )test_genericpathNignorez the macpath module is deprecatedc               @   sD   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dS )MacPathTestCasec             C   s   |  tdd d S )Nzxx:yy)assertEqualmacpathabspath)self r	   "/usr/lib/python3.7/test_macpath.pytest_abspath   s    zMacPathTestCase.test_abspathc             C   s   t j}| |d | |d | |d | |d | |d | |d | |d | |d | |d	 | |d
 | |d | |d | |d | |d d S )Nzxx:yyzxx:yy:zxx:Zfooz:fooz:foo:barz	:foo:bar:s   xx:yys   xx:yy:s   xx:s   foos   :foos   :foo:bars	   :foo:bar:)r   isabsZ
assertTrueZassertFalse)r   r   r	   r	   r
   
test_isabs   s    zMacPathTestCase.test_isabsc             C   s   t j}| |dd | |dd | |dd | |dd | |d	d
 | |dd | |dd | |dd d S )Nzfoo:bar)zfoo:barzconky:mountpoint:foo:bar)zconky:mountpoint:foor   :) r   z:conky:mountpoint:)z:conky:mountpointr   s   foo:bar)s   foo:s   bars   conky:mountpoint:foo:bar)s   conky:mountpoint:foos   bar   :)    r   s   :conky:mountpoint:)s   :conky:mountpointr   )r   splitr   )r   r   r	   r	   r
   
test_split#   s    





zMacPathTestCase.test_splitc             C   sv  t j}| |ddd | |ddd | |ddd | |ddd | |ddd | |dd	d | |d
d	d
 | |ddd | |d
dd
 | |ddd | |ddd | |dddd | |ddd | |ddd | |dddd | |ddd | |d
dd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |ddd | |dddd | |ddd  | |dd!d  | |dd"d!d# | |dd$d$ | |dd$d$ d S )%Nabz:a:bz:az:a:z:a::z:a::bz::br   za:r   za:bcza:b:cz:cz:bz:a:b:czb:   a   bs   :a:bs   :as   :a:s   :a::s   :a::bs   ::br   s   a:r   s   a:b   cs   a:b:cs   :cs   :bs   :a:b:cs   b:)r   joinr   )r   r   r	   r	   r
   	test_join7   sF    zMacPathTestCase.test_joinc             C   s   t j}| |dd | |dd | |dd | |dd | |d	d
 | |dd | |dd | |dd | |dd | |dd | |dd | |dd | |dd | |dd d S )Nz:foo.ext)z:fooz.extzfoo:foo.ext)zfoo:fooz.extz.ext)z.extr   zfoo.ext:foo)zfoo.ext:foor   z	:foo.ext:)z	:foo.ext:r   r   )r   r   zfoo.bar.ext)zfoo.barz.exts   :foo.ext)s   :foos   .exts   foo:foo.ext)s   foo:foos   .exts   .ext)s   .extr   s   foo.ext:foo)s   foo.ext:foor   s	   :foo.ext:)s	   :foo.ext:r   r   )r   r   s   foo.bar.ext)s   foo.bars   .ext)r   splitextr   )r   r   r	   r	   r
   test_splitext]   s    zMacPathTestCase.test_splitextc             C   s   t j}| |dd | |dd | |dd | |dd | |dd | |dd | |d	d | |d
d | |dd | |dd d S )Nza:Tza:bFza:b:r   r   s   a:s   a:bs   a:b:r   r   )r   ismountr   )r   r   r	   r	   r
   test_ismounto   s    zMacPathTestCase.test_ismountc             C   s*  t j}| |dd | |dd | |dd | |dd | t j|d | t j|d	 | |d
d
 | |dd | |dd | |dd | |dd | |dd | |dd | t j|d | t j|d | |dd | |dd | |dd d S )Nza:br   z:aza:b::cza:cz	a:b:c:::dza:dza::bza:b:::cr   za:za:b:s   a:br   s   :as   a:b::cs   a:cs	   a:b:c:::ds   a:ds   a::bs   a:b:::cr   s   a:s   a:b:)r   normpathr   ZassertRaisesZ
norm_error)r   r!   r	   r	   r
   test_normpath}   s&    zMacPathTestCase.test_normpathN)
__name__
__module____qualname__r   r   r   r   r   r    r"   r	   r	   r	   r
   r      s   &r   c               @   s   e Zd ZeZdZdS )MacCommonTestN)r#   r$   r%   r   Z
pathmoduleZtest_relpath_errorsr	   r	   r	   r
   r&      s   r&   __main__)Ztestr   Zunittestwarningscatch_warningsfilterwarningsDeprecationWarningr   ZTestCaser   Z
CommonTestr&   r#   mainr	   r	   r	   r
   <module>   s   
 	