@@ -1869,20 +1869,31 @@ def test_min_ts_time(self):
1869
1869
assert svg2 == svg3
1870
1870
1871
1871
def test_numeric_max_time_with_mutations_over_roots (self ):
1872
- t = self .get_mutations_over_roots_tree ()
1873
- max_time_value = 10.0 # Use a numeric max_time value
1872
+ max_time_value = 0.1 # Use a numeric max_time value
1873
+ params = {"y_ticks" : [1.23 ], "y_axis" : True }
1874
+ test_draw = {
1875
+ "svg_nomin" : {},
1876
+ "svg_min" : {"max_time" : max_time_value },
1877
+ "svg_log_min" : {"max_time" : max_time_value , "time_scale" : "log_time" },
1878
+ }
1874
1879
1875
- with pytest .warns (
1876
- UserWarning , match = "Mutations .* are above nodes which are not present"
1877
- ):
1878
- svg = t .draw_svg (max_time = max_time_value )
1879
- self .verify_basic_svg (svg )
1880
+ t = self .get_mutations_over_roots_tree ()
1881
+ assert t .tree_sequence .max_time > max_time_value
1880
1882
1881
- with pytest .warns (
1882
- UserWarning , match = "Mutations .* are above nodes which are not present"
1883
- ):
1884
- svg_log = t .draw_svg (max_time = max_time_value , time_scale = "log_time" )
1885
- self .verify_basic_svg (svg_log )
1883
+ for name , extra in test_draw .items ():
1884
+ with pytest .warns (
1885
+ UserWarning , match = "Mutations .* are above nodes which are not present"
1886
+ ):
1887
+ svg = t .draw_svg (** {** params , ** extra })
1888
+ assert svg .count ('class="tick"' ) == 1
1889
+ m = re .search (r'<g class="tick" transform="translate\((.*?)\)">' , svg )
1890
+ assert m is not None
1891
+ translate_coords = [float (x ) for x in m .group (1 ).split ()]
1892
+ if name == "svg_nomin" :
1893
+ # single tick within the plot region
1894
+ assert translate_coords [1 ] > 0
1895
+ else :
1896
+ assert translate_coords [1 ] < 0
1886
1897
1887
1898
#
1888
1899
# TODO: update the tests below here to check the new SVG based interface.
0 commit comments