<s> import pytest <EOL> from pkg_resources import Requirement , parse_version <EOL> from pex . package import EggPackage , SourcePackage <EOL> def test_source_packages ( ) : <EOL> for ext in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> sl = SourcePackage ( '<STR_LIT>' + ext ) <EOL> assert sl . _name == '<STR_LIT>' <EOL> assert sl . name == '<STR_LIT>' <EOL> assert sl . raw_version == '<STR_LIT>' <EOL> assert sl . version == parse_version ( sl . raw_version ) <EOL> for req in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> assert sl . satisfies ( req ) <EOL> assert sl . satisfies ( Requirement . parse ( req ) ) <EOL> for req in ( '<STR_LIT:foo>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> assert not sl . satisfies ( req ) <EOL> sl = SourcePackage ( '<STR_LIT>' ) <EOL> assert sl . name == '<STR_LIT>' <EOL> assert sl . raw_version == '<STR_LIT>' <EOL> def test_local_specifier ( ) : <EOL> for ext in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> sl = SourcePackage ( '<STR_LIT>' + ext ) <EOL> assert sl . name == '<STR_LIT>' <EOL> assert sl . raw_version == '<STR_LIT>' <EOL> assert sl . version == parse_version ( sl . raw_version ) <EOL> assert sl . satisfies ( '<STR_LIT>' ) <EOL> def test_egg_packages ( ) : <EOL> el = EggPackage ( '<STR_LIT>' ) <EOL> assert el . name == '<STR_LIT>' <EOL> assert el . raw_version == '<STR_LIT>' <EOL> assert el . py_version == '<STR_LIT>' <EOL> assert el . platform == '<STR_LIT>' <EOL> for req in ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) : <EOL> assert el . satisfies ( req ) <EOL> for req in ( '<STR_LIT:foo>' , '<STR_LIT>' ) : <EOL> assert not el . satisfies ( req ) <EOL> el = EggPackage ( '<STR_LIT>' ) <EOL> assert el . name == '<STR_LIT>' <EOL> assert el . raw_version == '<STR_LIT>' <EOL> assert el . py_version == '<STR_LIT>' <EOL> assert el . platform == '<STR_LIT>' <EOL> for req in ( '<STR_LIT>' , '<STR_LIT>' ) : <EOL> assert el . satisfies ( req ) <EOL> el = EggPackage ( '<STR_LIT>' ) <EOL> assert el . name == '<STR_LIT>' <EOL> assert el . raw_version == '<STR_LIT>' <EOL> assert el . py_version == '<STR_LIT>' <EOL> assert el . platform is None <EOL> with pytest . raises ( EggPackage . InvalidPackage ) : <EOL> EggPackage ( '<STR_LIT>' ) <EOL> with pytest . raises ( EggPackage . InvalidPackage ) : <EOL> EggPackage ( '<STR_LIT>' ) <EOL> with pytest . raises ( EggPackage . InvalidPackage ) : <EOL> EggPackage ( '<STR_LIT>' ) </s>
