Skip to content
This repository was archived by the owner on Mar 13, 2024. It is now read-only.

Commit ffa7044

Browse files
GDYendellgilesknap
authored andcommitted
Add test for missing branch coverage
1 parent a371869 commit ffa7044

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_dls_python3_skeleton.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import subprocess
22
import sys
33
from configparser import ConfigParser
4+
from os import makedirs
45
from pathlib import Path
56

67
import pytest
@@ -68,6 +69,25 @@ def test_new_module(tmp_path: Path):
6869
assert "Please delete ./docs/explanations/why-is-something-so.rst" in out
6970

7071

72+
def test_new_module_existing_dir(tmp_path: Path):
73+
module = tmp_path / "my-module"
74+
makedirs(module / "existing_dir")
75+
76+
with pytest.raises(Exception) as excinfo:
77+
check_output(
78+
sys.executable,
79+
"-m",
80+
"dls_python3_skeleton",
81+
"new",
82+
"--org=myorg",
83+
"--package=my_module",
84+
"--full-name=Firstname Lastname",
85+
86+
str(module),
87+
)
88+
assert "to not exist, or be an empty dir" in str(excinfo.value)
89+
90+
7191
def test_existing_module(tmp_path: Path):
7292
module = tmp_path / "scanspec"
7393
__main__.git(

0 commit comments

Comments
 (0)