Skip to content

Commit

Permalink
test for new templates (conan-io#15531)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Jan 25, 2024
1 parent 8f86d38 commit 0f13787
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conan/api/subapi/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class NewAPI:
def __init__(self, conan_api):
self.conan_api = conan_api

def get_builtin_template(self, template_name):
@staticmethod
def get_builtin_template(template_name):
from conan.internal.api.new.basic import basic_file
from conan.internal.api.new.alias_new import alias_file
from conan.internal.api.new.cmake_exe import cmake_exe_files
Expand Down
6 changes: 6 additions & 0 deletions conans/test/integration/command/new_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ class Conan(ConanFile):
conanfile = client.load("conanfile.py")
assert 'name = "hello"' in conanfile

def test_user_template_filenames(self):
client = TestClient()
save(os.path.join(client.cache_folder, "templates/command/new/mytemplate/{{name}}"), "Hi!")
client.run(f"new mytemplate -d name=pkg.txt")
assert "Hi!" == client.load("pkg.txt")

def test_skip_files(self):
client = TestClient()
template1 = textwrap.dedent("""
Expand Down

0 comments on commit 0f13787

Please sign in to comment.