Skip to content

Commit 92d3ddd

Browse files
author
Janneke van der Zwaan
committed
Add test for package name with space
1 parent bb48ac1 commit 92d3ddd

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/test_values.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,27 @@ def test_dash_in_project_slug(cookies):
7878
pytest.fail(e)
7979
finally:
8080
os.chdir(cwd)
81+
82+
83+
@pytest.mark.skipif(sys.platform.startswith('win'),
84+
reason='Skipping test with sh-module on Windows')
85+
def test_space_in_project_slug(cookies):
86+
ctx = {'project_slug': "my package"}
87+
project = cookies.bake(extra_context=ctx)
88+
89+
assert project.exit_code == 0
90+
91+
with open(os.path.join(str(project.project), 'setup.py')) as f:
92+
setup = f.read()
93+
print(setup)
94+
95+
cwd = os.getcwd()
96+
os.chdir(str(project.project))
97+
98+
try:
99+
sh.python(['setup.py', 'install'])
100+
sh.python(['setup.py', 'build_sphinx'])
101+
except sh.ErrorReturnCode as e:
102+
pytest.fail(e)
103+
finally:
104+
os.chdir(cwd)

0 commit comments

Comments
 (0)