Skip to content

Commit

Permalink
update testing to account for new stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Aug 24, 2017
1 parent 3e6eb7b commit 1cd49a4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
@@ -1,13 +1,15 @@
language: python
env:
- MPLBACKEND='agg'
python:
- '2.7'
- '3.4'
- '3.5'
- '3.6'
install:
- pip install .
- pip install -r requirements.txt
- pip install shapely coveralls
- pip install . # intsall package
- pip install -r requirements.txt # install requires
- pip install shapely coveralls matplotlib # only for testing
script:
- nosetests --verbose --with-coverage --cover-package=cartoframes
after_success:
Expand Down
9 changes: 8 additions & 1 deletion test/test_context.py
Expand Up @@ -218,15 +218,22 @@ def test_cartoframes_query(self):
def test_cartocontext_map(self):
"""CartoContext.map"""
from cartoframes import Layer, QueryLayer, BaseMap
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import IPython
cc = cartoframes.CartoContext(base_url=self.baseurl,
api_key=self.apikey)

# test with no layers - should produce basemap
basemap_only_static_mpl = cc.map(interactive=False)
cartoframes.context.HAS_MATPLOTLIB = False
basemap_only_static = cc.map(interactive=False)
basemap_only_interactive = cc.map(interactive=True)

# are of instance of IPython HTML class
# are of the correct type instances
self.assertIsInstance(basemap_only_static_mpl,
plt.Axes)
self.assertIsInstance(basemap_only_static,
IPython.core.display.HTML)
self.assertIsInstance(basemap_only_interactive,
Expand Down

0 comments on commit 1cd49a4

Please sign in to comment.