def test_savepng(): """ Tests if a wrong format of the picture gives error """ temp = ChaosGame(2) temp._generate_ngon() temp._generate_points(20) temp._starting_point() temp.iterate(10) a.savepng('filename.jpg')
def test_scaled(): """ Test scaling vector - sum of the elements should be equal to 0 """ temp = ChaosGame(4) temp._generate_ngon() temp._generate_points(20) temp._starting_point() temp.iterate(10) computed = np.sum(temp.new_r[0]) assert (1 - computed) == 0