update killswitch disabled test

This commit is contained in:
sneurlax 2023-09-08 14:14:36 -05:00
parent cdee218133
commit dea3be904e

View file

@ -1581,7 +1581,7 @@ void main() {
final mockPrefs = MockPrefs(); final mockPrefs = MockPrefs();
when(mockPrefs.useTor).thenAnswer((_) => true); when(mockPrefs.useTor).thenAnswer((_) => true);
when(mockPrefs.torKillswitch).thenAnswer((_) => true); when(mockPrefs.torKillswitch).thenAnswer((_) => false);
when(mockPrefs.wifiOnly).thenAnswer((_) => false); when(mockPrefs.wifiOnly).thenAnswer((_) => false);
final torService = MockTorService(); final torService = MockTorService();
when(torService.enabled).thenAnswer((_) => false); when(torService.enabled).thenAnswer((_) => false);
@ -1596,23 +1596,12 @@ void main() {
torService: torService, torService: torService,
); );
bool didThrow = false;
try {
final result = await client.getTransaction( final result = await client.getTransaction(
txHash: SampleGetTransactionData.txHash0, txHash: SampleGetTransactionData.txHash0,
verbose: true, verbose: true,
requestID: "some requestId"); requestID: "some requestId");
expect(result, SampleGetTransactionData.txData0); expect(result, SampleGetTransactionData.txData0);
} catch (e) {
didThrow = true;
// expect(e, isNotA<Exception>());
// expect(
// e.toString(),
// isNot(equals(
// "Exception: Tor preference and killswitch set but Tor is not enabled, not connecting to ElectrumX")));
}
expect(didThrow, isFalse);
verify(mockPrefs.wifiOnly).called(1); verify(mockPrefs.wifiOnly).called(1);
verify(mockPrefs.useTor).called(1); verify(mockPrefs.useTor).called(1);