Example #1
0
 def test_axis_type_mercator(self, range):
     assert (_get_axis_class("mercator", range, 0)) == (MercatorAxis, {
         'dimension': 'lon'
     })
     assert (_get_axis_class("mercator", range, 1)) == (MercatorAxis, {
         'dimension': 'lat'
     })
Example #2
0
 def test_axis_type_auto(self):
     assert(_get_axis_class("auto", FactorRange(), 0)) == (CategoricalAxis, {})
     assert(_get_axis_class("auto", FactorRange(), 1)) == (CategoricalAxis, {})
     assert(_get_axis_class("auto", DataRange1d(), 0)) == (LinearAxis, {})
     assert(_get_axis_class("auto", DataRange1d(), 1)) == (LinearAxis, {})
     assert(_get_axis_class("auto", Range1d(), 0)) == (LinearAxis, {})
     assert(_get_axis_class("auto", Range1d(), 1)) == (LinearAxis, {})
     assert(_get_axis_class("auto", Range1d(start=datetime.datetime(2018, 3, 21)), 0)) == (DatetimeAxis, {})
     assert(_get_axis_class("auto", Range1d(start=datetime.datetime(2018, 3, 21)), 1)) == (DatetimeAxis, {})
Example #3
0
 def test_axis_type_auto(self):
     assert(bph._get_axis_class("auto", FactorRange(), 0)) == (CategoricalAxis, {})
     assert(bph._get_axis_class("auto", FactorRange(), 1)) == (CategoricalAxis, {})
     assert(bph._get_axis_class("auto", DataRange1d(), 0)) == (LinearAxis, {})
     assert(bph._get_axis_class("auto", DataRange1d(), 1)) == (LinearAxis, {})
     assert(bph._get_axis_class("auto", Range1d(), 0)) == (LinearAxis, {})
     assert(bph._get_axis_class("auto", Range1d(), 1)) == (LinearAxis, {})
     assert(bph._get_axis_class("auto", Range1d(start=datetime.datetime(2018, 3, 21)), 0)) == (DatetimeAxis, {})
     assert(bph._get_axis_class("auto", Range1d(start=datetime.datetime(2018, 3, 21)), 1)) == (DatetimeAxis, {})
Example #4
0
 def test_axis_type_error(self, range):
     with pytest.raises(ValueError):
         bph._get_axis_class("junk", range, 0)
     with pytest.raises(ValueError):
         bph._get_axis_class("junk", range, 1)
Example #5
0
 def test_axis_type_datetime(self, range):
     assert (bph._get_axis_class("datetime", range,
                                 0)) == (DatetimeAxis, {})
     assert (bph._get_axis_class("datetime", range,
                                 1)) == (DatetimeAxis, {})
Example #6
0
 def test_axis_type_log(self, range):
     assert (bph._get_axis_class("log", range, 0)) == (LogAxis, {})
     assert (bph._get_axis_class("log", range, 1)) == (LogAxis, {})
Example #7
0
 def test_axis_type_linear(self, range):
     assert (bph._get_axis_class("linear", range, 0)) == (LinearAxis, {})
     assert (bph._get_axis_class("linear", range, 1)) == (LinearAxis, {})
Example #8
0
 def test_axis_type_None(self, range):
     assert (bph._get_axis_class(None, range, 0)) == (None, {})
     assert (bph._get_axis_class(None, range, 1)) == (None, {})
Example #9
0
 def test_axis_type_error(self, range):
     with pytest.raises(ValueError):
         _get_axis_class("junk", range, 0)
     with pytest.raises(ValueError):
         _get_axis_class("junk", range, 1)
Example #10
0
 def test_axis_type_mercator(self, range):
     assert(_get_axis_class("mercator", range, 0)) == (MercatorAxis, {'dimension': 'lon'})
     assert(_get_axis_class("mercator", range, 1)) == (MercatorAxis, {'dimension': 'lat'})
Example #11
0
 def test_axis_type_datetime(self, range):
     assert(_get_axis_class("datetime", range, 0)) == (DatetimeAxis, {})
     assert(_get_axis_class("datetime", range, 1)) == (DatetimeAxis, {})
Example #12
0
 def test_axis_type_log(self, range):
     assert(_get_axis_class("log", range, 0)) == (LogAxis, {})
     assert(_get_axis_class("log", range, 1)) == (LogAxis, {})
Example #13
0
 def test_axis_type_linear(self, range):
     assert(_get_axis_class("linear", range, 0)) == (LinearAxis, {})
     assert(_get_axis_class("linear", range, 1)) == (LinearAxis, {})
Example #14
0
 def test_axis_type_None(self, range):
     assert(_get_axis_class(None, range, 0)) == (None, {})
     assert(_get_axis_class(None, range, 1)) == (None, {})