import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
from javelin.grid import Grid


def test_init():
    grid = Grid()

    assert_array_equal(grid.bins, [101, 101, 1])
    assert_array_equal(grid.ll, [0, 0, 0])
    assert_array_equal(grid.lr, [1, 0, 0])
    assert_array_equal(grid.ul, [0, 1, 0])
    assert_array_equal(grid.tl, [0, 0, 1])
    assert_array_equal(grid.v1, [1, 0, 0])
    assert_array_equal(grid.v2, [0, 1, 0])
    assert_array_equal(grid.v3, [0, 0, 1])
    assert_array_equal(grid.r1, np.linspace(0, 1, 101))
    assert_array_equal(grid.r2, np.linspace(0, 1, 101))
    assert_array_equal(grid.r3, [0])