1717from pytest_mock import MockerFixture
1818
1919from cppython .project import Project , ProjectBuilder , ProjectConfiguration
20+ from cppython .utility import read_json , write_json
2021
2122default_pep621 = PEP621 (name = "test_name" , version = "1.0" )
2223default_cppython_data = CPPythonData (** {"target" : TargetEnum .EXE })
@@ -140,7 +141,7 @@ def test_presets(self, tmpdir):
140141 test_file = test_tool / "test.json"
141142 assert test_file .exists ()
142143
143- def test_root_presets (self , tmpdir ):
144+ def test_root_unmodified (self , tmpdir ):
144145 """
145146 TODO
146147 """
@@ -149,8 +150,27 @@ def test_root_presets(self, tmpdir):
149150 configuration = ProjectConfiguration (root_path = temporary_directory )
150151 builder = ProjectBuilder (configuration )
151152
153+ # TODO: Translate into reuseable testing data
154+ output = {
155+ "version" : 4 ,
156+ "cmakeMinimumRequired" : {"major" : 3 , "minor" : 23 , "patch" : 1 },
157+ "include" : ["should/be/replaced/cppython.json" ],
158+ "configurePresets" : [
159+ {
160+ "name" : "default" ,
161+ "inherits" : ["cppython" ],
162+ "hidden" : True ,
163+ "description" : "Tests that generator isn't removed" ,
164+ "generator" : "Should exist" ,
165+ },
166+ ],
167+ }
168+
152169 input_preset = temporary_directory / "CMakePresets.json"
153- with open (input_preset , "w" , encoding = "utf8" ) as file :
154- file .write ("{}" )
170+ write_json (input_preset , output )
155171
156172 builder .write_root_presets (temporary_directory / "test_location" )
173+
174+ data = read_json (input_preset )
175+
176+ # TODO: Assert the differences affect nothing but what is written by the builder
0 commit comments