@@ -209,31 +209,26 @@ def test_options_mixin():
209209 assert track .options and track .options ["foo" ] == "bar"
210210
211211
212- def test_local_data_mixin ():
213- track = hg .track ("heatmap" )
212+ def test_local_data_tileset ():
214213 tsinfo = {"min_pos" : [0 , 0 ], "max_pos" : [100 , 100 ]}
215214 data = [{"x" : 1 , "y" : 2 }]
216215
217- other = track .local_data (tsinfo , data )
218- assert track .uid != other .uid
219- assert track .data is None
216+ tileset = hg .LocalDataTileset (tsinfo , data )
217+ other = tileset .track ("heatmap" )
220218 assert other .data .type == "local-tiles"
221219 assert other .data .tilesetInfo ["x" ] == tsinfo
222220 assert other .data .tiles ["x.0.0.0" ] == data
223221
224- track2 = hg .track ("heatmap" )
225222 tsinfo_1d = {"min_pos" : [0 ], "max_pos" : [100 ]}
226- other2 = track2 . local_data (tsinfo_1d , data , inplace = True )
227- assert track2 is other2
228- assert track2 .data .tiles ["x.0.0" ] == data
223+ tileset_1d = hg . LocalDataTileset (tsinfo_1d , data )
224+ other_1d = tileset_1d . track ( "heatmap" )
225+ assert other_1d .data .tiles ["x.0.0" ] == data
229226
230227 with pytest .raises (ValueError , match = "min_pos and max_pos must have equal lengths" ):
231- hg .track ( "heatmap" ). local_data ({"min_pos" : [0 ], "max_pos" : [0 , 0 ]}, data )
228+ hg .LocalDataTileset ({"min_pos" : [0 ], "max_pos" : [0 , 0 ]}, data )
232229
233230 with pytest .raises (ValueError , match = "min_pos must be a one or two element array" ):
234- hg .track ("heatmap" ).local_data (
235- {"min_pos" : [0 , 0 , 0 ], "max_pos" : [0 , 0 , 0 ]}, data
236- )
231+ hg .LocalDataTileset ({"min_pos" : [0 , 0 , 0 ], "max_pos" : [0 , 0 , 0 ]}, data )
237232
238233
239234def test_plugin_track ():
0 commit comments