Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update mock so tools_tests checks pass.
  • Loading branch information
ditman committed Nov 4, 2022
commit 4660bb6e2686cc16d4f547cf6868696cd9dda78b
4 changes: 4 additions & 0 deletions script/tool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* Updates dependencies to `git:^2.2.0`, `mockito:^5.3.2` and regenerates mocks.

## 0.13.0

* Renames `all-plugins-app` to `create-all-packages-app` to clarify what it
Expand Down
4 changes: 2 additions & 2 deletions script/tool/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
collection: ^1.15.0
colorize: ^3.0.0
file: ^6.1.0
git: ^2.0.0
git: ^2.2.0
http: ^0.13.3
http_multi_server: ^3.0.1
meta: ^1.3.0
Expand All @@ -26,7 +26,7 @@ dependencies:
dev_dependencies:
build_runner: ^2.0.3
matcher: ^0.12.10
mockito: ^5.0.7
mockito: ^5.3.2

environment:
sdk: '>=2.12.0 <3.0.0'
320 changes: 235 additions & 85 deletions script/tool/test/common/package_command_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Mocks generated by Mockito 5.0.7 from annotations
// in flutter_plugin_tools/test/common_test.dart.
// Mocks generated by Mockito 5.3.2 from annotations
// in flutter_plugin_tools/test/common/package_command_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i6;
import 'dart:io' as _i4;

Expand All @@ -13,18 +14,47 @@ import 'package:git/src/tag.dart' as _i7;
import 'package:git/src/tree_entry.dart' as _i9;
import 'package:mockito/mockito.dart' as _i1;

// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: unnecessary_parenthesis

// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

// ignore_for_file: avoid_redundant_argument_values

class _FakeCommit extends _i1.Fake implements _i2.Commit {}
class _FakeCommit_0 extends _i1.SmartFake implements _i2.Commit {
_FakeCommit_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

class _FakeBranchReference extends _i1.Fake implements _i3.BranchReference {}
class _FakeBranchReference_1 extends _i1.SmartFake
implements _i3.BranchReference {
_FakeBranchReference_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

class _FakeProcessResult extends _i1.Fake implements _i4.ProcessResult {}
class _FakeProcessResult_2 extends _i1.SmartFake implements _i4.ProcessResult {
_FakeProcessResult_2(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [GitDir].
///
Expand All @@ -35,109 +65,229 @@ class MockGitDir extends _i1.Mock implements _i5.GitDir {
}

@override
String get path =>
(super.noSuchMethod(Invocation.getter(#path), returnValue: '') as String);
String get path => (super.noSuchMethod(
Invocation.getter(#path),
returnValue: '',
) as String);
@override
_i6.Future<int> commitCount([String? branchName = r'HEAD']) =>
(super.noSuchMethod(Invocation.method(#commitCount, [branchName]),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
(super.noSuchMethod(
Invocation.method(
#commitCount,
[branchName],
),
returnValue: _i6.Future<int>.value(0),
) as _i6.Future<int>);
@override
_i6.Future<_i2.Commit> commitFromRevision(String? revision) =>
(super.noSuchMethod(Invocation.method(#commitFromRevision, [revision]),
returnValue: Future<_i2.Commit>.value(_FakeCommit()))
as _i6.Future<_i2.Commit>);
(super.noSuchMethod(
Invocation.method(
#commitFromRevision,
[revision],
),
returnValue: _i6.Future<_i2.Commit>.value(_FakeCommit_0(
this,
Invocation.method(
#commitFromRevision,
[revision],
),
)),
) as _i6.Future<_i2.Commit>);
@override
_i6.Future<Map<String, _i2.Commit>> commits([String? branchName = r'HEAD']) =>
(super.noSuchMethod(Invocation.method(#commits, [branchName]),
returnValue:
Future<Map<String, _i2.Commit>>.value(<String, _i2.Commit>{}))
as _i6.Future<Map<String, _i2.Commit>>);
(super.noSuchMethod(
Invocation.method(
#commits,
[branchName],
),
returnValue:
_i6.Future<Map<String, _i2.Commit>>.value(<String, _i2.Commit>{}),
) as _i6.Future<Map<String, _i2.Commit>>);
@override
_i6.Future<_i3.BranchReference?> branchReference(String? branchName) =>
(super.noSuchMethod(Invocation.method(#branchReference, [branchName]),
returnValue:
Future<_i3.BranchReference?>.value(_FakeBranchReference()))
as _i6.Future<_i3.BranchReference?>);
(super.noSuchMethod(
Invocation.method(
#branchReference,
[branchName],
),
returnValue: _i6.Future<_i3.BranchReference?>.value(),
) as _i6.Future<_i3.BranchReference?>);
@override
_i6.Future<List<_i3.BranchReference>> branches() => (super.noSuchMethod(
Invocation.method(#branches, []),
returnValue:
Future<List<_i3.BranchReference>>.value(<_i3.BranchReference>[]))
as _i6.Future<List<_i3.BranchReference>>);
Invocation.method(
#branches,
[],
),
returnValue: _i6.Future<List<_i3.BranchReference>>.value(
<_i3.BranchReference>[]),
) as _i6.Future<List<_i3.BranchReference>>);
@override
_i6.Stream<_i7.Tag> tags() =>
(super.noSuchMethod(Invocation.method(#tags, []),
returnValue: Stream<_i7.Tag>.empty()) as _i6.Stream<_i7.Tag>);
_i6.Stream<_i7.Tag> tags() => (super.noSuchMethod(
Invocation.method(
#tags,
[],
),
returnValue: _i6.Stream<_i7.Tag>.empty(),
) as _i6.Stream<_i7.Tag>);
@override
_i6.Future<List<_i8.CommitReference>> showRef(
{bool? heads = false, bool? tags = false}) =>
_i6.Future<List<_i8.CommitReference>> showRef({
bool? heads = false,
bool? tags = false,
}) =>
(super.noSuchMethod(
Invocation.method(#showRef, [], {#heads: heads, #tags: tags}),
returnValue: Future<List<_i8.CommitReference>>.value(
<_i8.CommitReference>[]))
as _i6.Future<List<_i8.CommitReference>>);
@override
_i6.Future<_i3.BranchReference> currentBranch() =>
(super.noSuchMethod(Invocation.method(#currentBranch, []),
returnValue:
Future<_i3.BranchReference>.value(_FakeBranchReference()))
as _i6.Future<_i3.BranchReference>);
@override
_i6.Future<List<_i9.TreeEntry>> lsTree(String? treeish,
{bool? subTreesOnly = false, String? path}) =>
Invocation.method(
#showRef,
[],
{
#heads: heads,
#tags: tags,
},
),
returnValue: _i6.Future<List<_i8.CommitReference>>.value(
<_i8.CommitReference>[]),
) as _i6.Future<List<_i8.CommitReference>>);
@override
_i6.Future<_i3.BranchReference> currentBranch() => (super.noSuchMethod(
Invocation.method(
#currentBranch,
[],
),
returnValue:
_i6.Future<_i3.BranchReference>.value(_FakeBranchReference_1(
this,
Invocation.method(
#currentBranch,
[],
),
)),
) as _i6.Future<_i3.BranchReference>);
@override
_i6.Future<List<_i9.TreeEntry>> lsTree(
String? treeish, {
bool? subTreesOnly = false,
String? path,
}) =>
(super.noSuchMethod(
Invocation.method(#lsTree, [treeish],
{#subTreesOnly: subTreesOnly, #path: path}),
returnValue: Future<List<_i9.TreeEntry>>.value(<_i9.TreeEntry>[]))
as _i6.Future<List<_i9.TreeEntry>>);
Invocation.method(
#lsTree,
[treeish],
{
#subTreesOnly: subTreesOnly,
#path: path,
},
),
returnValue: _i6.Future<List<_i9.TreeEntry>>.value(<_i9.TreeEntry>[]),
) as _i6.Future<List<_i9.TreeEntry>>);
@override
_i6.Future<String?> createOrUpdateBranch(
String? branchName, String? treeSha, String? commitMessage) =>
String? branchName,
String? treeSha,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(
#createOrUpdateBranch, [branchName, treeSha, commitMessage]),
returnValue: Future<String?>.value('')) as _i6.Future<String?>);
Invocation.method(
#createOrUpdateBranch,
[
branchName,
treeSha,
commitMessage,
],
),
returnValue: _i6.Future<String?>.value(),
) as _i6.Future<String?>);
@override
_i6.Future<String> commitTree(String? treeSha, String? commitMessage,
{List<String>? parentCommitShas}) =>
_i6.Future<String> commitTree(
String? treeSha,
String? commitMessage, {
List<String>? parentCommitShas,
}) =>
(super.noSuchMethod(
Invocation.method(#commitTree, [treeSha, commitMessage],
{#parentCommitShas: parentCommitShas}),
returnValue: Future<String>.value('')) as _i6.Future<String>);
Invocation.method(
#commitTree,
[
treeSha,
commitMessage,
],
{#parentCommitShas: parentCommitShas},
),
returnValue: _i6.Future<String>.value(''),
) as _i6.Future<String>);
@override
_i6.Future<Map<String, String>> writeObjects(List<String>? paths) =>
(super.noSuchMethod(Invocation.method(#writeObjects, [paths]),
returnValue:
Future<Map<String, String>>.value(<String, String>{}))
as _i6.Future<Map<String, String>>);
(super.noSuchMethod(
Invocation.method(
#writeObjects,
[paths],
),
returnValue: _i6.Future<Map<String, String>>.value(<String, String>{}),
) as _i6.Future<Map<String, String>>);
@override
_i6.Future<_i4.ProcessResult> runCommand(Iterable<String>? args,
{bool? throwOnError = true}) =>
_i6.Future<_i4.ProcessResult> runCommand(
Iterable<String>? args, {
bool? throwOnError = true,
bool? echoOutput = false,
}) =>
(super.noSuchMethod(
Invocation.method(#runCommand, [args], {#throwOnError: throwOnError}),
returnValue:
Future<_i4.ProcessResult>.value(_FakeProcessResult())) as _i6
.Future<_i4.ProcessResult>);
Invocation.method(
#runCommand,
[args],
{
#throwOnError: throwOnError,
#echoOutput: echoOutput,
},
),
returnValue: _i6.Future<_i4.ProcessResult>.value(_FakeProcessResult_2(
this,
Invocation.method(
#runCommand,
[args],
{
#throwOnError: throwOnError,
#echoOutput: echoOutput,
},
),
)),
) as _i6.Future<_i4.ProcessResult>);
@override
_i6.Future<bool> isWorkingTreeClean() =>
(super.noSuchMethod(Invocation.method(#isWorkingTreeClean, []),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
_i6.Future<bool> isWorkingTreeClean() => (super.noSuchMethod(
Invocation.method(
#isWorkingTreeClean,
[],
),
returnValue: _i6.Future<bool>.value(false),
) as _i6.Future<bool>);
@override
_i6.Future<_i2.Commit?> updateBranch(
String? branchName,
_i6.Future<dynamic> Function(_i4.Directory)? populater,
String? commitMessage) =>
String? branchName,
_i6.Future<void> Function(_i4.Directory)? populater,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(
#updateBranch, [branchName, populater, commitMessage]),
returnValue: Future<_i2.Commit?>.value(_FakeCommit()))
as _i6.Future<_i2.Commit?>);
Invocation.method(
#updateBranch,
[
branchName,
populater,
commitMessage,
],
),
returnValue: _i6.Future<_i2.Commit?>.value(),
) as _i6.Future<_i2.Commit?>);
@override
_i6.Future<_i2.Commit?> updateBranchWithDirectoryContents(String? branchName,
String? sourceDirectoryPath, String? commitMessage) =>
_i6.Future<_i2.Commit?> updateBranchWithDirectoryContents(
String? branchName,
String? sourceDirectoryPath,
String? commitMessage,
) =>
(super.noSuchMethod(
Invocation.method(#updateBranchWithDirectoryContents,
[branchName, sourceDirectoryPath, commitMessage]),
returnValue: Future<_i2.Commit?>.value(_FakeCommit()))
as _i6.Future<_i2.Commit?>);
Invocation.method(
#updateBranchWithDirectoryContents,
[
branchName,
sourceDirectoryPath,
commitMessage,
],
),
returnValue: _i6.Future<_i2.Commit?>.value(),
) as _i6.Future<_i2.Commit?>);
}