feat: add Gemini and Spartan protocol support
This commit is contained in:
parent
a4a49f41d7
commit
fa7aa5557c
48 changed files with 4992 additions and 161 deletions
33
app/test/key_store_test.dart
Normal file
33
app/test/key_store_test.dart
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:mews/application/key_store.dart';
|
||||
|
||||
void main() {
|
||||
late Directory dir;
|
||||
late KeyStore keys;
|
||||
|
||||
setUp(() async {
|
||||
dir = await Directory.systemTemp.createTemp('mews-keys');
|
||||
keys = KeyStore(() async => dir);
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
dir.deleteSync(recursive: true);
|
||||
});
|
||||
|
||||
test('a key is stored, read back and removed', () async {
|
||||
expect(await keys.read(7), isNull);
|
||||
|
||||
await keys.save(7, 'KEY PEM');
|
||||
expect(await keys.read(7), 'KEY PEM');
|
||||
|
||||
// Saving again replaces, the way a renewed identity replaces its key.
|
||||
await keys.save(7, 'NEW KEY PEM');
|
||||
expect(await keys.read(7), 'NEW KEY PEM');
|
||||
|
||||
await keys.delete(7);
|
||||
expect(await keys.read(7), isNull);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue