-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_project.py
39 lines (31 loc) · 997 Bytes
/
test_project.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
34
35
36
37
38
39
import pytest
from project import *
import os
def main():
test_DownloadData()
test_data_processing()
test_get_NDVI()
test_get_band()
test_get_boundary()
def test_DownloadData():
path = os.path.dirname(__file__)
bands=[4,5]
assert DownloadData('Shanghai','2020-01-01','2020-12-31',5,path,bands)==True
def test_data_processing():
path = os.path.dirname(__file__)
assert data_processing('Beijing',path)==True
assert data_processing('Shanghai',path)==True
def test_get_NDVI():
path = os.path.dirname(__file__)
ndvi=get_NDVI(path,"shanghai")
assert len(ndvi) > 0
def test_get_band():
path = os.path.dirname(__file__)
assert get_band(path,'Beijing',4)==True
assert get_band(path,'Beijing',5)==True
def test_get_boundary():
path = os.path.dirname(__file__)
city_shape = get_boundary('beijing',path)
assert city_shape.length > 0
if __name__ == "__main__":
main()