File tree Expand file tree Collapse file tree 4 files changed +39
-7
lines changed Expand file tree Collapse file tree 4 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,15 @@ classifiers = [
3030 " Typing :: Typed" ,
3131]
3232dynamic = [" version" ]
33- dependencies = [" pybamm" ]
33+ dependencies = [" pybamm" , " cookiecutter " ]
3434
3535[project .optional-dependencies ]
3636dev = [
3737 " pytest >=6" ,
3838 " pytest-cov >=3" ,
3939 " nox" ,
4040 " pre-commit" ,
41+ " pytest-cookies" ,
4142]
4243docs = [
4344 " sphinx" ,
Original file line number Diff line number Diff line change 55"""
66from __future__ import annotations
77
8+ import pybamm
9+
810from ._version import version as __version__
911
10- __all__ : tuple [str ] = ("__version__" ,)
12+ __all__ : list [str ] = [
13+ "__version__" ,
14+ "pybamm" ,
15+ ]
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ import pybamm_cookiecutter as m
2+ import pytest
3+
4+ def test_version () -> None :
5+ assert m .__version__
6+
7+ @pytest .fixture
8+ def custom_template (tmpdir ):
9+ """
10+ Generating a project using the template into a tempdir
11+ """
12+ template = tmpdir .ensure ("cookiecutter-template" , dir = True )
13+ template .join ("cookiecutter.json" ).write ('{"project_name": "pybamm_cookie"}' )
14+
15+ repo_dir = template .ensure ("{{cookiecutter.project_name}}" , dir = True )
16+ repo_dir .join ("README.rst" ).write ("{{cookiecutter.project_name}}" )
17+
18+ return template
19+
20+
21+ def test_bake_custom_project (cookies , custom_template ):
22+ """
23+ Testing if the projects exists in the tempdir
24+ """
25+ result = cookies .bake (template = str (custom_template ))
26+
27+ assert result .exit_code == 0
28+ assert result .exception is None
29+
30+ assert result .project_path .name == "pybamm_cookie"
31+ assert result .project_path .is_dir ()
You can’t perform that action at this time.
0 commit comments