File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change 77Copyright 2023 NeuroML contributors
88"""
99
10+ import random
11+ import pytest
1012import unittest
1113import logging
1214import pathlib as pl
1921
2022
2123class TestPlot (BaseTestCase ):
22-
2324 """Test Plot module"""
2425
26+ @pytest .mark .localonly
27+ def test_generate_plot_animated (self ):
28+ """Test generate_plot function."""
29+ filename = "tests/plot/test_generate_plot.gif"
30+
31+ # remove the file first
32+ try :
33+ pl .Path (filename ).unlink ()
34+ except FileNotFoundError :
35+ pass
36+
37+ numpoints = 1000
38+ xs = range (0 , numpoints )
39+ ys = random .choices (list (range (0 , 1000 )), k = numpoints )
40+ ys2 = random .choices (list (range (0 , 1500 )), k = numpoints )
41+
42+ generate_plot (
43+ [xs , xs ],
44+ [ys , ys2 ],
45+ "Test plot" ,
46+ xaxis = "x" ,
47+ yaxis = "y" ,
48+ grid = False ,
49+ show_plot_already = True ,
50+ animate = True ,
51+ legend_position = "right" ,
52+ )
53+
54+ """
55+ TODO: used when testing file save
56+ self.assertIsFile(filename)
57+ pl.Path(filename).unlink()
58+ """
59+
2560 def test_generate_plot (self ):
2661 """Test generate_plot function."""
2762 filename = "tests/plot/test_generate_plot.png"
You can’t perform that action at this time.
0 commit comments