U
    kufj                     @   sX   d dl mZ d dlZd dlZd dlZd dlmZ G dd dejZG dd dejZ	dS )    )
namedtupleN)json2packagec                   @   s   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d Z
dd Zdd Zdd Zdd Zdd Zdd Zd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 ).TestPackagec                 C   s@   t jt jtd}tt| | _t	t| | _
d S )Nzpackage.jsonospathjoindirname__file__jsonloadsopenreadr   packageselfr    r   6/tmp/pip-unpacked-wheel-pz57x_63/tests/test_package.pysetUp   s
    zTestPackage.setUpc                 C   s   |  d| j  d S )Nz<Package yarg>)assertEqualsr   __repr__r   r   r   r   	test_repr   s    zTestPackage.test_reprc                 C   s   |  d| jj d S )NZyarg)r   r   namer   r   r   r   	test_name   s    zTestPackage.test_namec                 C   s   |  d| jj d S )Nz http://pypi.python.org/pypi/yarg)r   r   pypi_urlr   r   r   r   test_pypi_url   s    zTestPackage.test_pypi_urlc                 C   s   |  d| jj d S )NzThis is the short summary.)r   r   summaryr   r   r   r   test_summary   s    zTestPackage.test_summaryc                 C   s   |  d| jj d S )NzThis is the long description.)r   r   descriptionr   r   r   r   test_description   s    zTestPackage.test_descriptionc                 C   s   |  d| jj d S )Nzhttps://kura.io/yarg/r   r   Zhomepager   r   r   r   test_homepage"   s    zTestPackage.test_homepagec                 C   s   |  d| jj d S )Nz#https://github.com/kura/yarg/issuesr   r   Z
bugtrackerr   r   r   r   test_bugtracker&   s    zTestPackage.test_bugtrackerc                 C   s   |  d| jj d S )Nzhttp://yarg.readthedocs.org/r   r   Zdocsr   r   r   r   	test_docs*   s    zTestPackage.test_docsc                 C   s&   t dd}| |ddd| jj d S )NZAuthor
name emailKurakura@kura.ior   email)r   r   r   author)r   r,   r   r   r   test_author.   s    
zTestPackage.test_authorc                 C   s&   t dd}| |ddd| jj d S )NZ
Maintainerr'   r(   r)   r*   )r   r   r   
maintainer)r   r.   r   r   r   test_maintainer3   s    
zTestPackage.test_maintainerc                 C   s   |  d| jj d S )NMIT)r   r   licenser   r   r   r   test_license8   s    zTestPackage.test_licensec                 C   s   |  d| jj d S )NzMIT License)r   r   Zlicense_from_classifiersr   r   r   r   test_license_from_classifiers<   s    z)TestPackage.test_license_from_classifiersc                 C   s(   t dd}| |dddd| jj d S )NZ	Downloadszday week monthiф  i i0 )dayweekmonth)r   r   r   	downloads)r   r7   r   r   r   test_downloads@   s    
zTestPackage.test_downloadsc                 C   s,   |  ddddddddd	d
ddg| jj d S )Nz+Development Status :: 5 - Production/StablezIntended Audience :: Developersz&License :: OSI Approved :: MIT LicensezProgramming Language :: Pythonz%Programming Language :: Python :: 2.6z%Programming Language :: Python :: 2.7z#Programming Language :: Python :: 3z%Programming Language :: Python :: 3.1z%Programming Language :: Python :: 3.2z%Programming Language :: Python :: 3.3z;Programming Language :: Python :: Implementation :: CPythonz8Programming Language :: Python :: Implementation :: PyPy)r   r   classifiersr   r   r   r   test_classifiersE   s    zTestPackage.test_classifiersc                 C   s   |  dddg| jj d S )N0.0.0z0.0.20.0.15)r   r   Zrelease_idsr   r   r   r   test_release_idsT   s    zTestPackage.test_release_idsc                 C   s   |  d| jj d S )Nr<   r   r   Zlatest_release_idr   r   r   r   test_latest_release_idX   s    z"TestPackage.test_latest_release_idc                 C   s   |  d| jj d S NTr   r   Z	has_wheelr   r   r   r   test_has_wheel[   s    zTestPackage.test_has_wheelc                 C   s   |  d| jj d S NFr   r   Zhas_eggr   r   r   r   test_has_egg^   s    zTestPackage.test_has_eggc                 C   s   |  d| jj d S r@   r   r   Z
has_sourcer   r   r   r   test_has_sourcea   s    zTestPackage.test_has_sourcec                 C   s   |  dddddg| jj d S )Nz2.6z2.7z3.1z3.2z3.3)r   r   python_versionsr   r   r   r   test_python_versionsd   s    z TestPackage.test_python_versionsc                 C   s   |  ddg| jj d S )NCPythonPyPy)r   r   Zpython_implementationsr   r   r   r   test_python_implementationsh   s    
z'TestPackage.test_python_implementationsN)__name__
__module____qualname__r   r   r   r   r   r    r"   r$   r&   r-   r/   r2   r3   r8   r:   r=   r?   rB   rE   rG   rI   rL   r   r   r   r   r   	   s,   r   c                   @   sL   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d Z
dS )TestPackageMissingDatac                 C   s@   t jt jtd}tt| | _t	t| | _
d S )Nz-package_no_homepage_bugtrack_one_release.jsonr   r   r   r   r   r   o   s
    zTestPackageMissingData.setUpc                 C   s   |  d | jj d S Nr!   r   r   r   r   r"   v   s    z$TestPackageMissingData.test_homepagec                 C   s   |  d | jj d S rQ   r#   r   r   r   r   r$   y   s    z&TestPackageMissingData.test_bugtrackerc                 C   s   |  d | jj d S rQ   r%   r   r   r   r   r&   |   s    z TestPackageMissingData.test_docsc                 C   s   |  d| jj d S )Nr;   r>   r   r   r   r   r?      s    z-TestPackageMissingData.test_latest_release_idc                 C   s   |  d| jj d S rC   rA   r   r   r   r   rB      s    z%TestPackageMissingData.test_has_wheelc                 C   s   |  d| jj d S r@   rD   r   r   r   r   rE      s    z#TestPackageMissingData.test_has_eggc                 C   s   |  d| jj d S rC   rF   r   r   r   r   rG      s    z&TestPackageMissingData.test_has_sourceN)rM   rN   rO   r   r"   r$   r&   r?   rB   rE   rG   r   r   r   r   rP   m   s   rP   )
collectionsr   r   r   ZunittestZyarg.packager   ZTestCaser   rP   r   r   r   r   <module>   s   d