Esempio n. 1
0
 def test_specific_check_satpy(self):
     """Test 'check_satpy' with specific features provided."""
     from satpy.utils import check_satpy
     with mock.patch('satpy.utils.print') as print_mock:
         check_satpy(readers=['viirs_sdr'], extras=('cartopy', '__fake'))
         checked_fake = False
         for call in print_mock.mock_calls:
             if len(call[1]) > 0 and '__fake' in call[1][0]:
                 self.assertNotIn('ok', call[1][1])
                 checked_fake = True
         self.assertTrue(
             checked_fake, "Did not find __fake module "
             "mentioned in checks")
def check_satpy_features():
    print("Checking Satpy features...\n")
    readers = ['abi_l1b', 'viirs_sdr']
    writers = ['cf', 'geotiff', 'simple_image']
    extras = ['cartopy', 'geoviews']
    out = io.StringIO()
    with redirect_stdout(out):
        check_satpy(readers=readers, writers=writers, extras=extras)
    out_str = out.getvalue()
    print(out_str)

    for feature in readers + writers + extras:
        if feature + ":  ok" not in out_str:
            print(
                "FAIL: Missing or corrupt Satpy dependency (see above for details)."
            )
            return False
    return True
Esempio n. 3
0
 def test_basic_check_satpy(self):
     """Test 'check_satpy' basic functionality."""
     from satpy.utils import check_satpy
     check_satpy()