@@ -1132,39 +1132,39 @@ def test_validate_gantt(self):
1132
1132
1133
1133
# validate the basic gantt inputs
1134
1134
1135
- df = [dict ( Task = 'Job A' ,
1136
- Start = '2009-02-01' ,
1137
- Finish = '2009-08-30' ,
1138
- Complete = 'a' ) ]
1135
+ df = [{ ' Task' : 'Job A' ,
1136
+ ' Start' : '2009-02-01' ,
1137
+ ' Finish' : '2009-08-30' ,
1138
+ ' Complete' : 'a' } ]
1139
1139
1140
- pattern2 = (" In order to use an indexing column and assign colors to "
1141
- " the values of the index, you must choose an actual "
1142
- " column name in the dataframe or key if a list of "
1143
- " dictionaries is being used." )
1140
+ pattern2 = (' In order to use an indexing column and assign colors to '
1141
+ ' the values of the index, you must choose an actual '
1142
+ ' column name in the dataframe or key if a list of '
1143
+ ' dictionaries is being used.' )
1144
1144
1145
1145
self .assertRaisesRegexp (PlotlyError , pattern2 ,
1146
1146
tls .FigureFactory .create_gantt ,
1147
1147
df , index_col = 'foo' )
1148
1148
1149
1149
df = 'foo'
1150
1150
1151
- pattern3 = (" You must input either a dataframe or a list of "
1152
- " dictionaries." )
1151
+ pattern3 = (' You must input either a dataframe or a list of '
1152
+ ' dictionaries.' )
1153
1153
1154
1154
self .assertRaisesRegexp (PlotlyError , pattern3 ,
1155
1155
tls .FigureFactory .create_gantt , df )
1156
1156
1157
1157
df = []
1158
1158
1159
- pattern4 = (" Your list is empty. It must contain at least one "
1160
- " dictionary." )
1159
+ pattern4 = (' Your list is empty. It must contain at least one '
1160
+ ' dictionary.' )
1161
1161
1162
1162
self .assertRaisesRegexp (PlotlyError , pattern4 ,
1163
1163
tls .FigureFactory .create_gantt , df )
1164
1164
1165
1165
df = ['foo' ]
1166
1166
1167
- pattern5 = (" Your list must only include dictionaries." )
1167
+ pattern5 = (' Your list must only include dictionaries.' )
1168
1168
1169
1169
self .assertRaisesRegexp (PlotlyError , pattern5 ,
1170
1170
tls .FigureFactory .create_gantt , df )
@@ -1173,27 +1173,27 @@ def test_gantt_index(self):
1173
1173
1174
1174
# validate the index used for gantt
1175
1175
1176
- df = [dict ( Task = 'Job A' ,
1177
- Start = '2009-02-01' ,
1178
- Finish = '2009-08-30' ,
1179
- Complete = 50 ) ]
1176
+ df = [{ ' Task' : 'Job A' ,
1177
+ ' Start' : '2009-02-01' ,
1178
+ ' Finish' : '2009-08-30' ,
1179
+ ' Complete' : 50 } ]
1180
1180
1181
- pattern = (" In order to use an indexing column and assign colors to "
1182
- " the values of the index, you must choose an actual "
1183
- " column name in the dataframe or key if a list of "
1184
- " dictionaries is being used." )
1181
+ pattern = (' In order to use an indexing column and assign colors to '
1182
+ ' the values of the index, you must choose an actual '
1183
+ ' column name in the dataframe or key if a list of '
1184
+ ' dictionaries is being used.' )
1185
1185
1186
1186
self .assertRaisesRegexp (PlotlyError , pattern ,
1187
1187
tls .FigureFactory .create_gantt ,
1188
1188
df , index_col = 'foo' )
1189
1189
1190
- df = [dict ( Task = ' Job A' , Start = '2009-02-01' ,
1191
- Finish = ' 2009-08-30' , Complete = 'a' ) ,
1192
- dict ( Task = ' Job A' , Start = '2009-02-01' ,
1193
- Finish = ' 2009-08-30' , Complete = 50 ) ]
1190
+ df = [{ ' Task' : ' Job A' , ' Start' : '2009-02-01' ,
1191
+ ' Finish' : ' 2009-08-30' , ' Complete' : 'a' } ,
1192
+ { ' Task' : ' Job A' , ' Start' : '2009-02-01' ,
1193
+ ' Finish' : ' 2009-08-30' , ' Complete' : 50 } ]
1194
1194
1195
- pattern2 = (" Error in indexing column. Make sure all entries of each "
1196
- " column are all numbers or all strings." )
1195
+ pattern2 = (' Error in indexing column. Make sure all entries of each '
1196
+ ' column are all numbers or all strings.' )
1197
1197
1198
1198
self .assertRaisesRegexp (PlotlyError , pattern2 ,
1199
1199
tls .FigureFactory .create_gantt ,
@@ -1203,13 +1203,13 @@ def test_gantt_validate_colors(self):
1203
1203
1204
1204
# validate the gantt colors variable
1205
1205
1206
- df = [dict ( Task = ' Job A' , Start = '2009-02-01' ,
1207
- Finish = ' 2009-08-30' , Complete = 75 , Resource = 'A' ) ,
1208
- dict ( Task = ' Job B' , Start = '2009-02-01' ,
1209
- Finish = ' 2009-08-30' , Complete = 50 , Resource = 'B' ) ]
1206
+ df = [{ ' Task' : ' Job A' , ' Start' : '2009-02-01' ,
1207
+ ' Finish' : ' 2009-08-30' , ' Complete' : 75 , ' Resource' : 'A' } ,
1208
+ { ' Task' : ' Job B' , ' Start' : '2009-02-01' ,
1209
+ ' Finish' : ' 2009-08-30' , ' Complete' : 50 , ' Resource' : 'B' } ]
1210
1210
1211
- pattern = (" Whoops! The elements in your rgb colors tuples cannot "
1212
- " exceed 255.0." )
1211
+ pattern = (' Whoops! The elements in your rgb colors tuples cannot '
1212
+ ' exceed 255.0.' )
1213
1213
1214
1214
self .assertRaisesRegexp (PlotlyError , pattern ,
1215
1215
tls .FigureFactory .create_gantt , df ,
@@ -1218,8 +1218,8 @@ def test_gantt_validate_colors(self):
1218
1218
self .assertRaises (PlotlyError , tls .FigureFactory .create_gantt ,
1219
1219
df , index_col = 'Complete' , colors = 'foo' )
1220
1220
1221
- pattern2 = (" Whoops! The elements in your colors tuples cannot "
1222
- " exceed 1.0." )
1221
+ pattern2 = (' Whoops! The elements in your colors tuples cannot '
1222
+ ' exceed 1.0.' )
1223
1223
1224
1224
self .assertRaisesRegexp (PlotlyError , pattern2 ,
1225
1225
tls .FigureFactory .create_gantt , df ,
@@ -1229,8 +1229,8 @@ def test_gantt_validate_colors(self):
1229
1229
# values in the index column
1230
1230
colors_dict = {75 : 'rgb(1, 2, 3)' }
1231
1231
1232
- pattern3 = (" If you are using colors as a dictionary, all of its "
1233
- " keys must be all the values in the index column." )
1232
+ pattern3 = (' If you are using colors as a dictionary, all of its '
1233
+ ' keys must be all the values in the index column.' )
1234
1234
1235
1235
self .assertRaisesRegexp (PlotlyError , pattern3 ,
1236
1236
tls .FigureFactory .create_gantt , df ,
@@ -1239,9 +1239,9 @@ def test_gantt_validate_colors(self):
1239
1239
# check: index is set if colors is a dictionary
1240
1240
colors_dict_good = {50 : 'rgb(1, 2, 3)' , 75 : 'rgb(5, 10, 15)' }
1241
1241
1242
- pattern4 = (" Error. You have set colors to a dictionary but have not "
1243
- " picked an index. An index is required if you are "
1244
- " assigning colors to particular values in a dictioanry." )
1242
+ pattern4 = (' Error. You have set colors to a dictionary but have not '
1243
+ ' picked an index. An index is required if you are '
1244
+ ' assigning colors to particular values in a dictioanry.' )
1245
1245
1246
1246
self .assertRaisesRegexp (PlotlyError , pattern4 ,
1247
1247
tls .FigureFactory .create_gantt , df ,
@@ -1272,14 +1272,15 @@ def test_gantt_validate_colors(self):
1272
1272
def test_gantt_all_args (self ):
1273
1273
1274
1274
# check if gantt chart matches with expected output
1275
- df = [dict (Task = "Run" ,
1276
- Start = '2010-01-01' ,
1277
- Finish = '2011-02-02' ,
1278
- Complete = 0 ),
1279
- dict (Task = "Fast" ,
1280
- Start = '2011-01-01' ,
1281
- Finish = '2012-06-05' ,
1282
- Complete = 25 )]
1275
+
1276
+ df = [{'Task' : 'Run' ,
1277
+ 'Start' : '2010-01-01' ,
1278
+ 'Finish' : '2011-02-02' ,
1279
+ 'Complete' : 0 },
1280
+ {'Task' : 'Fast' ,
1281
+ 'Start' : '2011-01-01' ,
1282
+ 'Finish' : '2012-06-05' ,
1283
+ 'Complete' : 25 }]
1283
1284
1284
1285
test_gantt_chart = tls .FigureFactory .create_gantt (
1285
1286
df , colors = 'Blues' , index_col = 'Complete' , reverse_colors = True ,
0 commit comments