mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
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:
parent
791a782a8f
commit
adf279f308
@ -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');
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user