Example #1
0
def test_create_flat_names_2d():
    shape = 2, 3
    result = ttab.create_flat_names("x", shape)
    expected = ["x__0_0", "x__0_1", "x__0_2", "x__1_0", "x__1_1", "x__1_2"]
    assert result == expected
    assert ttab._create_shape(result) == shape
Example #2
0
def test_create_flat_names_3d():
    shape = 2, 3, 4
    assert ttab._create_shape(ttab.create_flat_names("x", shape)) == shape
Example #3
0
def test_create_flat_names_1d():
    shape = (2, )
    result = ttab.create_flat_names("x", shape)
    expected = ["x__0", "x__1"]
    assert result == expected
    assert ttab._create_shape(result) == shape