<s> """<STR_LIT>""" <EOL> import warnings <EOL> from graphy import graphy_test <EOL> from graphy import pie_chart <EOL> from graphy . backends import google_chart_api <EOL> from graphy . backends . google_chart_api import base_encoder_test <EOL> class PieChartTest ( base_encoder_test . BaseChartTest ) : <EOL> def tearDown ( self ) : <EOL> warnings . resetwarnings ( ) <EOL> super ( PieChartTest , self ) . tearDown ( ) <EOL> def GetChart ( self , * args , ** kwargs ) : <EOL> return google_chart_api . PieChart ( * args , ** kwargs ) <EOL> def AddToChart ( self , chart , points , color = None , label = None ) : <EOL> return chart . AddSegment ( points [ <NUM_LIT:0> ] , color = color , label = label ) <EOL> def testCanRemoveDefaultFormatters ( self ) : <EOL> pass <EOL> def testChartType ( self ) : <EOL> self . chart . display . is3d = False <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT:p>' ) <EOL> self . chart . display . is3d = True <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testEmptyChart ( self ) : <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testChartCreation ( self ) : <EOL> self . chart = self . GetChart ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT:p>' ) <EOL> def testAddSegment ( self ) : <EOL> self . chart = self . GetChart ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . chart . AddSegment ( <NUM_LIT:4> , label = '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testAddMultipleSegments ( self ) : <EOL> warnings . filterwarnings ( '<STR_LIT:ignore>' ) <EOL> self . chart . AddSegments ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . AddSegments ( [ <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testMultiplePies ( self ) : <EOL> self . chart . AddPie ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT:p>' ) <EOL> self . chart . AddPie ( [ <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testMultiplePiesNo3d ( self ) : <EOL> chart = self . GetChart ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> chart . AddPie ( [ <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> chart . display . is3d = True <EOL> warnings . filterwarnings ( '<STR_LIT:error>' ) <EOL> self . assertRaises ( RuntimeWarning , chart . display . Url , <NUM_LIT> , <NUM_LIT> ) <EOL> def testAddSegmentByIndex ( self ) : <EOL> self . chart = self . GetChart ( [ <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> ] , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . chart . AddSegment ( <NUM_LIT:4> , '<STR_LIT>' , pie_index = <NUM_LIT:0> ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . AddPie ( [ <NUM_LIT:4> , <NUM_LIT:5> ] , [ '<STR_LIT>' , '<STR_LIT>' ] , [ ] ) <EOL> self . chart . AddSegment ( <NUM_LIT:6> , '<STR_LIT>' , pie_index = <NUM_LIT:1> ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testSetColors ( self ) : <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . AddSegment ( <NUM_LIT:1> , label = '<STR_LIT>' ) <EOL> self . chart . AddSegment ( <NUM_LIT:5> , label = '<STR_LIT>' ) <EOL> self . chart . SetColors ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . AddSegment ( <NUM_LIT:6> , label = '<STR_LIT>' ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testHugeSegmentSizes ( self ) : <EOL> self . chart = self . GetChart ( [ <NUM_LIT> L , <NUM_LIT> L ] , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . display . enhanced_encoding = True <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testSetSegmentSize ( self ) : <EOL> segment1 = self . chart . AddSegment ( <NUM_LIT:1> ) <EOL> segment2 = self . chart . AddSegment ( <NUM_LIT:2> ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> segment2 . size = <NUM_LIT:3> <EOL> self . assertEquals ( segment1 . size , <NUM_LIT:1> ) <EOL> self . assertEquals ( segment2 . size , <NUM_LIT:3> ) <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> def testChartAngle ( self ) : <EOL> self . assertTrue ( '<STR_LIT>' not in self . chart . display . _Params ( self . chart ) ) <EOL> self . chart . display . angle = <NUM_LIT> <EOL> self . assertEqual ( self . Param ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . chart . display . angle = <NUM_LIT:0> <EOL> self . assertTrue ( '<STR_LIT>' not in self . chart . display . _Params ( self . chart ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> graphy_test . main ( ) </s>
