generated from palewire/python-open-source-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.py
51 lines (41 loc) · 1.35 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/env python
import itertools
import random
import time
import unittest
from rich import print
from nasa_wildfires import get_modis, get_viirs_noaa, get_viirs_suomi, options
COMBO_LIST = list(
itertools.product(options.REGION_DICT.keys(), options.TIME_RANGE_LIST)
)
class NasaWildfiresUnitTest(unittest.TestCase):
"""Test the nasa_wildfires package."""
def test_modis(self):
"""Test the MODIS function."""
print("Testing MODIS")
get_modis()
combinations = random.sample(COMBO_LIST, 5)
for c in combinations:
print(f"Testing MODIS with {c}")
time.sleep(1)
get_modis(*c)
def test_viirs_suomi(self):
"""Test the VIIRS Suomi function."""
print("Testing VIIRS Suomi")
get_viirs_suomi()
combinations = random.sample(COMBO_LIST, 5)
for c in combinations:
print(f"Testing VIIRS Suomi with {c}")
time.sleep(1)
get_viirs_suomi(*c)
def test_viirs_noaa(self):
"""Test the VIIRS NOAA function."""
print("Testing VIIRS NOAA")
get_viirs_noaa()
combinations = random.sample(COMBO_LIST, 5)
for c in combinations:
print(f"Testing VIIRS NOAA with {c}")
time.sleep(1)
get_viirs_noaa(*c)
if __name__ == "__main__":
unittest.main()