0

I want to write a unittest that checks if the savefig(outfile) method saves my figure with the input name that I specified for the 'outfile'. Savefig(outfile) is a method inside my class. So far I have written this code, but I don't know how to be sure that it works

def test_savepng():
    n = 100
    example = ChaosGame(n=3)
    example.iterate(n)
    example.plot()
    example.savepng('test')
    assert example.savepng('test') == 'test.png'

the method also checks if outfile has '.png' in it, if not it will attach it to its end.

N.A.
  • 103
  • 6

0 Answers0