<s> from __future__ import absolute_import <EOL> from nose . plugins . attrib import attr <EOL> from plotly . tests . utils import compare_dict <EOL> from plotly . tests . test_optional . optional_utils import run_fig <EOL> from plotly . tests . test_optional . test_matplotlylib . data . lines import * <EOL> from plotly . tools import _matplotlylib_imported <EOL> if _matplotlylib_imported : <EOL> import matplotlib <EOL> matplotlib . use ( '<STR_LIT>' ) <EOL> import matplotlib . pyplot as plt <EOL> @ attr ( '<STR_LIT>' ) <EOL> def test_simple_line ( ) : <EOL> fig , ax = plt . subplots ( ) <EOL> ax . plot ( D [ '<STR_LIT>' ] , D [ '<STR_LIT>' ] , label = '<STR_LIT>' ) <EOL> renderer = run_fig ( fig ) <EOL> for data_no , data_dict in enumerate ( renderer . plotly_fig [ '<STR_LIT:data>' ] ) : <EOL> equivalent , msg = compare_dict ( data_dict , SIMPLE_LINE [ '<STR_LIT:data>' ] [ data_no ] ) <EOL> assert equivalent , msg <EOL> equivalent , msg = compare_dict ( renderer . plotly_fig [ '<STR_LIT>' ] , <EOL> SIMPLE_LINE [ '<STR_LIT>' ] ) <EOL> assert equivalent , msg <EOL> @ attr ( '<STR_LIT>' ) <EOL> def test_complicated_line ( ) : <EOL> fig , ax = plt . subplots ( ) <EOL> ax . plot ( D [ '<STR_LIT>' ] , D [ '<STR_LIT>' ] , '<STR_LIT>' , markersize = <NUM_LIT:10> , alpha = <NUM_LIT> , label = '<STR_LIT>' ) <EOL> ax . plot ( D [ '<STR_LIT>' ] , D [ '<STR_LIT>' ] , '<STR_LIT>' , linewidth = <NUM_LIT:2> , alpha = <NUM_LIT> , label = '<STR_LIT>' ) <EOL> ax . plot ( D [ '<STR_LIT>' ] , D [ '<STR_LIT>' ] , '<STR_LIT>' , markeredgewidth = <NUM_LIT:2> , <EOL> markersize = <NUM_LIT:10> , alpha = <NUM_LIT> , label = '<STR_LIT>' ) <EOL> ax . plot ( D [ '<STR_LIT>' ] , D [ '<STR_LIT>' ] , '<STR_LIT>' , linewidth = <NUM_LIT:2> , alpha = <NUM_LIT> , label = '<STR_LIT>' ) <EOL> renderer = run_fig ( fig ) <EOL> for data_no , data_dict in enumerate ( renderer . plotly_fig [ '<STR_LIT:data>' ] ) : <EOL> equivalent , msg = compare_dict ( data_dict , <EOL> COMPLICATED_LINE [ '<STR_LIT:data>' ] [ data_no ] ) <EOL> assert equivalent , msg <EOL> equivalent , msg = compare_dict ( renderer . plotly_fig [ '<STR_LIT>' ] , <EOL> COMPLICATED_LINE [ '<STR_LIT>' ] ) <EOL> assert equivalent , msg </s>
