def test_get_script_from_egg(): egg_path = './tests/example_packages/eno-0.0.17-py2.7.egg' dists = list(find_eggs_in_zip(zipimport.zipimporter(egg_path), egg_path, only=True)) assert len(dists) == 1 dist = dists[0] location, content = get_script_from_egg('run_eno_server', dist) assert os.path.join(egg_path, 'EGG-INFO/scripts/run_eno_server') == location assert content.startswith('#!'), 'Expected a `scripts` style script with shebang.' assert (None, None) == get_script_from_egg('non_existent_script', dist)
def test_get_script_from_egg(): egg_path = './tests/example_packages/eno-0.0.17-py2.7.egg' dists = list(pkg_resources.find_eggs_in_zip(zipimport.zipimporter(egg_path), egg_path, only=True)) assert len(dists) == 1 dist = dists[0] location, content = get_script_from_egg('run_eno_server', dist) assert os.path.join(egg_path, 'EGG-INFO/scripts/run_eno_server') == location assert content.startswith('#!'), 'Expected a `scripts` style script with shebang.' assert (None, None) == get_script_from_egg('non_existent_script', dist)
def test_get_script_from_egg_with_no_scripts(): # Make sure eggs without scripts don't cause errors. egg_path = './tests/example_packages/Flask_Cache-0.13.1-py2.7.egg' dists = list(find_eggs_in_zip(zipimport.zipimporter(egg_path), egg_path, only=True)) assert len(dists) == 1 dist = dists[0] assert (None, None) == get_script_from_egg('non_existent_script', dist)
def test_get_script_from_egg_with_no_scripts(): # Make sure eggs without scripts don't cause errors. egg_path = './tests/example_packages/Flask_Cache-0.13.1-py2.7.egg' dists = list(pkg_resources.find_eggs_in_zip(zipimport.zipimporter(egg_path), egg_path, only=True)) assert len(dists) == 1 dist = dists[0] assert (None, None) == get_script_from_egg('non_existent_script', dist)
def test_get_script_from_egg(): # Make sure eggs without scripts don't cause errors dists = list( find_eggs_in_zip( zipimport.zipimporter('./tests/example_packages/Flask_Cache-0.13.1-py2.7.egg'), './tests/example_packages/Flask_Cache-0.13.1-py2.7.egg', only=True)) assert len(dists) == 1 (location, content) = get_script_from_egg('non_existent_script', dists[0]) assert location is None assert content is None
def test_get_script_from_egg(): # Make sure eggs without scripts don't cause errors dists = list( find_eggs_in_zip( zipimport.zipimporter( './tests/example_packages/Flask_Cache-0.13.1-py2.7.egg'), './tests/example_packages/Flask_Cache-0.13.1-py2.7.egg', only=True)) assert len(dists) == 1 (location, content) = get_script_from_egg('non_existent_script', dists[0]) assert location is None assert content is None