def test_linetype_palettes(): N = 4 # distinct linetypes s = scale_linetype_discrete() items = s.palette(N) assert (len(items) == N) assert (all([isinstance(x, str) for x in items])) items = s.palette(N + 5) assert (all([isinstance(x, str) for x in items[:N]])) with pytest.raises(PlotnineError): s = scale_linetype_continuous()
def test_linetype_palettes(): N = 4 # distinct linetypes s = scale_linetype_discrete() items = s.palette(N) assert(len(items) == N) assert(all([isinstance(x, six.string_types) for x in items])) items = s.palette(N+5) assert(all([isinstance(x, six.string_types) for x in items[:N]])) with pytest.raises(PlotnineError): s = scale_linetype_continuous()