Fix template manifest test (#148616)

`'flutter create should tool exit if the template manifest cannot be read'` fails consistently, as shown by #148614.

The test expects a `ToolExit` with the message "Unable to read the template manifest", but depending on how the test is being run, a different exception ("Cannot create a project within the Flutter SDK") is sometimes thrown first.

This pull request relocates the test project to `dev/` to prevent the extraneous error.
This commit is contained in:
Nate 2024-05-18 17:42:22 -06:00 committed by GitHub
parent 791a782a8f
commit adf279f308
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3776,7 +3776,7 @@ void main() {
'--no-pub', '--no-pub',
'--template=plugin', '--template=plugin',
'--project-name=test', '--project-name=test',
projectDir.path, 'dev/test',
]), ]),
throwsToolExit(message: 'Unable to read the template manifest at path'), throwsToolExit(message: 'Unable to read the template manifest at path'),
); );
@ -3784,8 +3784,7 @@ void main() {
FileSystem: () => MemoryFileSystem.test( FileSystem: () => MemoryFileSystem.test(
opHandle: (String context, FileSystemOp operation) { opHandle: (String context, FileSystemOp operation) {
if (operation == FileSystemOp.read && context.contains('template_manifest.json')) { if (operation == FileSystemOp.read && context.contains('template_manifest.json')) {
throw io.PathNotFoundException( throw io.PathNotFoundException(context, const OSError(), 'Cannot open file');
context, const OSError(), 'Cannot open file');
} }
}, },
), ),