Skip to content

Commit 3447f9e

Browse files
committed
Add test
Signed-off-by: Bennati, Stefano <[email protected]>
1 parent 2954747 commit 3447f9e

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

tests/data/setup-distutils.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
Copyright 2018 Matthew Aynalem
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
"""
16+
from distutils.core import setup
17+
from setuptools import find_packages
18+
19+
setup(
20+
name='packer.py',
21+
version='0.3.0',
22+
author='Matthew Aynalem',
23+
author_email='[email protected]',
24+
packages=['packerpy'],
25+
url='https://github.com/mayn/packer.py',
26+
license='Apache License 2.0',
27+
description='packer.py - python library to run hashicorp packer CLI commands',
28+
keywords="hashicorp packer",
29+
install_requires=[
30+
],
31+
classifiers=[
32+
'License :: OSI Approved :: Apache Software License',
33+
'Programming Language :: Python :: 2',
34+
'Programming Language :: Python :: 2.7',
35+
'Programming Language :: Python :: 3',
36+
'Programming Language :: Python :: 3.4',
37+
'Programming Language :: Python :: 3.5',
38+
'Programming Language :: Python :: 3.6',
39+
],
40+
)

tests/test_setup_py_live_eval.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
REQ = abspath(join(dirname(__file__), "./data/requirements.devel.txt"))
1919
SETUP = abspath(join(dirname(__file__), "./data/setup.txt"))
20+
SETUP_DISTUTILS = abspath(join(dirname(__file__), "./data/setup-distutils.txt"))
2021

2122

2223
def test_iter_requirements_with_setup_py():
@@ -29,3 +30,15 @@ def test_iter_requirements_with_setup_py():
2930

3031
# Dev
3132
assert list(iter_requirements("dev", [], SETUP)) == ["click>=6.1.0", "mock>=1.3.0"]
33+
34+
35+
def test_iter_requirements_with_setup_py_distutils():
36+
"""Test against setup.py files which import distutils"""
37+
# Min
38+
assert list(iter_requirements("min", [], SETUP_DISTUTILS)) == []
39+
40+
# PyPI
41+
assert list(iter_requirements("pypi", [], SETUP_DISTUTILS)) == []
42+
43+
# Dev
44+
assert list(iter_requirements("dev", [], SETUP_DISTUTILS)) == []

0 commit comments

Comments
 (0)