Skip to content

Commit

Permalink
test: removed unused at_end2end_test/test/commons.dart
Browse files Browse the repository at this point in the history
chore: removed a TODO
  • Loading branch information
gkc committed Dec 12, 2024
1 parent 84419de commit 810578e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 126 deletions.
119 changes: 0 additions & 119 deletions tests/at_end2end_test/test/commons.dart

This file was deleted.

19 changes: 13 additions & 6 deletions tests/at_end2end_test/test/e2e_test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,17 @@ Future<SimpleOutboundSocketHandler> getSocketHandler(atSign) async {
if (asc == null) {
throw _NoSuchAtSignException('$atSign not configured');
}
// TODO switch on _AtSignConfig.connectionType and create a
// TODO SimpleOutboundSocketConnection or SimpleOutboundWebsocketConnection
// TODO as required
var handler = SimpleOutboundSocketHandler._(asc.host, asc.port, atSign);

// ignore: prefer_typing_uninitialized_variables
var handler;
switch(asc.connectionType!) {
case _ConnectionTypeEnum.socket:
handler = SimpleOutboundSocketHandler._(asc.host, asc.port, atSign);
break;
case _ConnectionTypeEnum.websocket:
// TODO e.g. handler = SimpleOutboundWebsocketConnection._(asc.host, asc.port, atSign);
throw UnimplementedError('e2e_test_utils cannot yet create a websocket connection');
}

await handler.connect();
handler.startListening();
Expand Down Expand Up @@ -212,11 +219,11 @@ class _AtSignConfig {
String atSign;
String host;
int port;
_ConnectionTypeEnum connectionType;
_ConnectionTypeEnum? connectionType;

/// Creates and adds to [atSignConfigMap] or throws [_AtSignAlreadyAddedException] if we've already got it.
_AtSignConfig(this.atSign, this.host, this.port, this.connectionType) {
this.connectionType ??= _ConnectionTypeEnum.socket;
connectionType ??= _ConnectionTypeEnum.socket;
if (atSignConfigMap.containsKey(atSign)) {
throw _AtSignAlreadyAddedException("AtSignConfig for $atSign has already been created");
}
Expand Down
3 changes: 2 additions & 1 deletion tests/at_end2end_test/test/update_verb_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:math';

import 'package:test/test.dart';

import 'commons.dart';
import 'e2e_test_utils.dart' as e2e;

void main() {
Expand Down Expand Up @@ -77,6 +76,8 @@ void main() {
expect(response, contains('data:$value'));

//LOOKUP VERB in the other secondary
var maxRetryCount = 10;
var retryCount = 1;
while (true) {
await sh2.writeCommand('llookup:cached:$atSign_2:youtube_id$atSign_1');
response = await sh2.read();
Expand Down

0 comments on commit 810578e

Please sign in to comment.