forked from Open-EO/openeo-grassgis-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_udf.py
33 lines (24 loc) · 989 Bytes
/
test_udf.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: utf-8 -*-
import unittest
from flask import json
from openeo_grass_gis_driver.test_base import TestBase
from openeo_grass_gis_driver.udf import SUPPORTED_UDF
from openeo_grass_gis_driver.udf_lang_udf_type import python_udfs
__license__ = "Apache License, Version 2.0"
__author__ = "Sören Gebbert"
__copyright__ = "Copyright 2018, Sören Gebbert, mundialis"
__maintainer__ = "Soeren Gebbert"
__email__ = "soerengebbert@googlemail.com"
class UdfTestCase(TestBase):
def otest_udf(self):
response = self.app.get('/udf', headers=self.auth)
data = json.loads(response.data.decode())
print(data)
self.assertEqual(data, SUPPORTED_UDF)
def otest_udf_lang(self):
response = self.app.get('/udf/python/udf_reduce_time', headers=self.auth)
data = json.loads(response.data.decode())
print(data)
self.assertEqual(data, python_udfs["python"]["udf_reduce_time"])
if __name__ == "__main__":
unittest.main()