Coverage for tests/test_graphics.py: 100%

1 import numpy as np

2 import pytest

3

4 from flexfrac1d.lib import graphics as gr

5

6

7@pytest.mark.parametrize("resolution", (1, 0.5, 2.1, 4))

8 def test_num_for_linspace(resolution):

9 lengths = (23, 12.8, 36.7)

10 nums = gr._linspace_nums(resolution, lengths)

11 assert len(nums) == len(lengths)

12 for num, length in zip(nums, lengths):

13 x = np.linspace(0, length, num)

14 assert x[0] <= resolution