22 lines
768 B
Dart
22 lines
768 B
Dart
import 'package:cpd_app/image_uploader.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
test('Test OCR functionality', () async {
|
|
final ImageUploader imageUploader = ImageUploader();
|
|
String imageName = "lorem.png";
|
|
|
|
var img = await imageUploader.buildImageFile(imageName);
|
|
assert(img.lengthInBytes > 0);
|
|
|
|
// momentan auskommentiert, weil das pathproviderplugin irgentwie gemockt werden muss und ich es noch nicht hinbekommen habe
|
|
//mock response, weil man keine http requests in tests machen kann
|
|
// String mockResponse = "eng";
|
|
|
|
// String text = await imageUploader.performOcr(img, imageName, mockResponse);
|
|
// assert(text.contains("Lorem ipsum"));
|
|
});
|
|
}
|