File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ def get_short_url(self):
6666
6767 def get_bytes (self ):
6868 resp = self ._post ('https://quickchart.io/chart' )
69- return response .content
69+ return resp .content
7070
7171 def to_file (self , path ):
7272 content = self .get_bytes ()
Original file line number Diff line number Diff line change @@ -33,5 +33,21 @@ def test_no_chart(self):
3333
3434 self .assertRaises (RuntimeError , qc .get_url )
3535
36+ def test_get_bytes (self ):
37+ qc = QuickChart ()
38+ qc .width = 600
39+ qc .height = 300
40+ qc .config = {
41+ "type" : "bar" ,
42+ "data" : {
43+ "labels" : ["Hello world" , "Test" ],
44+ "datasets" : [{
45+ "label" : "Foo" ,
46+ "data" : [1 , 2 ]
47+ }]
48+ }
49+ }
50+ self .assertTrue (len (qc .get_bytes ()) > 8000 )
51+
3652if __name__ == '__main__' :
3753 unittest .main ()
You can’t perform that action at this time.
0 commit comments