-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds tests for GDAL not installed (#71)
* Adds tests for GDAL not installed * typo in travis else * proper matrix build * semicolons...I write python * updates test with conditional osr * Proper pytest skipping enabled for conditional imports * missed pytest import * Typos * Mixing pytest and unittest * typos and imports * typos city * removes hasosr * fixes wrapper for conditional gdal * Removes test for non-available gdal
- Loading branch information
Showing
11 changed files
with
155 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import importlib | ||
import warnings | ||
|
||
cam = importlib.find_loader('usgscam') | ||
cycsm_isd = importlib.find_loader('cycsm.isd') | ||
|
||
if cam: | ||
cam = cam.load_module() | ||
|
||
if cycsm_isd: | ||
cycsm_isd = cycsm_isd.load_module() | ||
|
||
def conditional_cameras(func): | ||
def cam_check(*args, **kwargs): | ||
if cam: | ||
return func(*args, **kwargs) | ||
else: | ||
warning.warn('Trying to call a camera method, but usgscam is not installed.') | ||
return None | ||
return cam_check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.