<s> """<STR_LIT>""" <EOL> import os <EOL> import shutil <EOL> import tempfile <EOL> import unittest <EOL> import textwrap <EOL> try : <EOL> import ast <EOL> except : <EOL> pass <EOL> import pkg_resources <EOL> from setuptools . tests . py26compat import skipIf <EOL> def DALS ( s ) : <EOL> "<STR_LIT>" <EOL> return textwrap . dedent ( s ) . lstrip ( ) <EOL> class TestDistInfo ( unittest . TestCase ) : <EOL> def test_distinfo ( self ) : <EOL> dists = { } <EOL> for d in pkg_resources . find_distributions ( self . tmpdir ) : <EOL> dists [ d . project_name ] = d <EOL> assert len ( dists ) == <NUM_LIT:2> , dists <EOL> unversioned = dists [ '<STR_LIT>' ] <EOL> versioned = dists [ '<STR_LIT>' ] <EOL> assert versioned . version == '<STR_LIT>' <EOL> assert unversioned . version == '<STR_LIT>' <EOL> @ skipIf ( '<STR_LIT>' not in globals ( ) , <EOL> "<STR_LIT>" ) <EOL> def test_conditional_dependencies ( self ) : <EOL> requires = [ pkg_resources . Requirement . parse ( '<STR_LIT>' ) , <EOL> pkg_resources . Requirement . parse ( '<STR_LIT>' ) ] <EOL> for d in pkg_resources . find_distributions ( self . tmpdir ) : <EOL> self . assertEqual ( d . requires ( ) , requires [ : <NUM_LIT:1> ] ) <EOL> self . assertEqual ( d . requires ( extras = ( '<STR_LIT>' , ) ) , requires ) <EOL> self . assertEqual ( d . extras , [ '<STR_LIT>' ] ) <EOL> def setUp ( self ) : <EOL> self . tmpdir = tempfile . mkdtemp ( ) <EOL> versioned = os . path . join ( self . tmpdir , <EOL> '<STR_LIT>' ) <EOL> os . mkdir ( versioned ) <EOL> metadata_file = open ( os . path . join ( versioned , '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> metadata_file . write ( DALS ( <EOL> """<STR_LIT>""" ) ) <EOL> metadata_file . close ( ) <EOL> unversioned = os . path . join ( self . tmpdir , <EOL> '<STR_LIT>' ) <EOL> os . mkdir ( unversioned ) <EOL> metadata_file = open ( os . path . join ( unversioned , '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> metadata_file . write ( DALS ( <EOL> """<STR_LIT>""" ) ) <EOL> metadata_file . close ( ) <EOL> def tearDown ( self ) : <EOL> shutil . rmtree ( self . tmpdir ) </s>
