-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from highcharts-for-python/develop
PR for v.1.4.6
- Loading branch information
Showing
4 changed files
with
270 additions
and
64 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '1.4.5' | ||
__version__ = '1.4.6' |
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,260 @@ | ||
"""Tests for ``highcharts.no_data``.""" | ||
|
||
import pytest | ||
|
||
from json.decoder import JSONDecodeError | ||
|
||
from highcharts_stock.options.series.data.flags import FlagData as cls4 | ||
from highcharts_stock import errors | ||
from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ | ||
Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ | ||
Class_from_js_literal | ||
|
||
STANDARD_PARAMS_4 = [ | ||
({}, None), | ||
({ | ||
'title': 'Test Title', | ||
'x': 123, | ||
|
||
'data_labels': { | ||
'align': 'center', | ||
'allowOverlap': True, | ||
'animation': { | ||
'defer': 5 | ||
}, | ||
'backgroundColor': { | ||
'linearGradient': { | ||
'x1': 0.123, | ||
'x2': 0.234, | ||
'y1': 0.345, | ||
'y2': 0.456 | ||
}, | ||
'stops': [ | ||
[0.12, '#999'], | ||
[0.34, '#fff'] | ||
] | ||
}, | ||
'borderColor': '#999999', | ||
'borderRadius': 24, | ||
'borderWidth': 1, | ||
'className': 'some-class-name', | ||
'color': '#000000', | ||
'crop': True, | ||
'defer': False, | ||
'enabled': True, | ||
'filter': { | ||
'operator': '>=', | ||
'property': 'some_property', | ||
'value': 123 | ||
}, | ||
'format': 'some format', | ||
'formatter': """function() { return true; }""", | ||
'inside': True, | ||
'nullFormat': 'some format', | ||
'nullFormatter': """function() { return true; }""", | ||
'overflow': 'none', | ||
'padding': 12, | ||
'position': 'center', | ||
'rotation': 0, | ||
'shadow': False, | ||
'shape': 'rect', | ||
'style': 'style goes here', | ||
'useHTML': False, | ||
'verticalAlign': 'top', | ||
'x': 10, | ||
'y': 20, | ||
'z': 0 | ||
}, | ||
'drag_drop': { | ||
'draggableX': True, | ||
'draggableY': True, | ||
'dragHandle': { | ||
'className': 'draghandle-classname-goes-here', | ||
'color': '#ccc', | ||
'cursor': 'alias', | ||
'lineColor': '#ddd', | ||
'lineWidth': 2, | ||
'pathFormatter': """function() { return true; }""", | ||
'zIndex': 10 | ||
}, | ||
'dragMaxX': 3456, | ||
'dragMaxY': 6532, | ||
'dragMinX': 123, | ||
'dragMinY': 321, | ||
'dragPrecisionX': 5, | ||
'dragPrecisionY': 5, | ||
'dragSensitivity': 2, | ||
'groupBy': 'some-property-name', | ||
'guideBox': { | ||
'default': { | ||
'className': 'some-classname-goes-here', | ||
'color': '#999', | ||
'cursor': 'pointer', | ||
'lineColor': '#ccc', | ||
'lineWidth': 2, | ||
'zIndex': 100 | ||
} | ||
}, | ||
'liveRedraw': True | ||
}, | ||
'drilldown': 'some-id-goes-here' | ||
}, None), | ||
# + DataBase | ||
({ | ||
'title': 'test title', | ||
'x': 123, | ||
|
||
'data_labels': { | ||
'align': 'center', | ||
'allowOverlap': True, | ||
'animation': { | ||
'defer': 5 | ||
}, | ||
'backgroundColor': { | ||
'linearGradient': { | ||
'x1': 0.123, | ||
'x2': 0.234, | ||
'y1': 0.345, | ||
'y2': 0.456 | ||
}, | ||
'stops': [ | ||
[0.12, '#999'], | ||
[0.34, '#fff'] | ||
] | ||
}, | ||
'borderColor': '#999999', | ||
'borderRadius': 24, | ||
'borderWidth': 1, | ||
'className': 'some-class-name', | ||
'color': '#000000', | ||
'crop': True, | ||
'defer': False, | ||
'enabled': True, | ||
'filter': { | ||
'operator': '>=', | ||
'property': 'some_property', | ||
'value': 123 | ||
}, | ||
'format': 'some format', | ||
'formatter': """function() { return true; }""", | ||
'inside': True, | ||
'nullFormat': 'some format', | ||
'nullFormatter': """function() { return true; }""", | ||
'overflow': 'none', | ||
'padding': 12, | ||
'position': 'center', | ||
'rotation': 0, | ||
'shadow': False, | ||
'shape': 'rect', | ||
'style': 'style goes here', | ||
'useHTML': False, | ||
'verticalAlign': 'top', | ||
'x': 10, | ||
'y': 20, | ||
'z': 0 | ||
}, | ||
'drag_drop': { | ||
'draggableX': True, | ||
'draggableY': True, | ||
'dragHandle': { | ||
'className': 'draghandle-classname-goes-here', | ||
'color': '#ccc', | ||
'cursor': 'alias', | ||
'lineColor': '#ddd', | ||
'lineWidth': 2, | ||
'pathFormatter': """function() { return true; }""", | ||
'zIndex': 10 | ||
}, | ||
'dragMaxX': 3456, | ||
'dragMaxY': 6532, | ||
'dragMinX': 123, | ||
'dragMinY': 321, | ||
'dragPrecisionX': 5, | ||
'dragPrecisionY': 5, | ||
'dragSensitivity': 2, | ||
'groupBy': 'some-property-name', | ||
'guideBox': { | ||
'default': { | ||
'className': 'some-classname-goes-here', | ||
'color': '#999', | ||
'cursor': 'pointer', | ||
'lineColor': '#ccc', | ||
'lineWidth': 2, | ||
'zIndex': 100 | ||
} | ||
}, | ||
'liveRedraw': True | ||
}, | ||
'drilldown': 'some-id-goes-here', | ||
|
||
'accessibility': { | ||
'description': 'Some description goes here', | ||
'enabled': True | ||
}, | ||
'class_name': 'some-class-name', | ||
'color': '#ccc', | ||
'color_index': 2, | ||
'custom': { | ||
'some_key': 123, | ||
'other_key': 456 | ||
}, | ||
'description': 'Some description goes here', | ||
'events': { | ||
'click': """function(event) { return true; }""", | ||
'drag': """function(event) { return true; }""", | ||
'drop': """function(event) { return true; }""", | ||
'mouseOut': """function(event) { return true; }""" | ||
}, | ||
'id': 'some-id-goes-here', | ||
'label_rank': 3, | ||
'name': 'Some Name Goes here', | ||
'selected': False | ||
}, None), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS_4) | ||
def test_FlagData__init__(kwargs, error): | ||
Class__init__(cls4, kwargs, error) | ||
|
||
|
||
@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS_4) | ||
def test_FlagData__to_untrimmed_dict(kwargs, error): | ||
Class__to_untrimmed_dict(cls4, kwargs, error) | ||
|
||
|
||
@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS_4) | ||
def test_FlagData_from_dict(kwargs, error): | ||
Class_from_dict(cls4, kwargs, error) | ||
|
||
|
||
@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS_4) | ||
def test_FlagData_to_dict(kwargs, error): | ||
Class_to_dict(cls4, kwargs, error) | ||
|
||
|
||
@pytest.mark.parametrize('filename, as_file, error', [ | ||
('series/data/single_point/04.js', False, None), | ||
('series/data/single_point/error-04.js', | ||
False, | ||
(errors.HighchartsValueError, | ||
errors.HighchartsParseError, | ||
JSONDecodeError, | ||
TypeError, | ||
ValueError)), | ||
('series/data/single_point/04.js', True, None), | ||
('series/data/single_point/error-04.js', | ||
True, | ||
(errors.HighchartsValueError, | ||
errors.HighchartsParseError, | ||
JSONDecodeError, | ||
TypeError, | ||
ValueError)), | ||
]) | ||
def test_FlagData_from_js_literal(input_files, filename, as_file, error): | ||
Class_from_js_literal(cls4, input_files, filename, as_file, error) | ||
|