Beispiel #1
0
def testGridUserAdjacentToEndStateFailValidation():
    grid = numpy.zeros((3, 3), str)
    grid[1][1] = 'U'
    grid[0][1] = 'T'
    assert (gridbuild.validateGrid(grid)) == False
    grid[0][1] = 'P'
    assert (gridbuild.validateGrid(grid)) == False
Beispiel #2
0
def testGridUserStoneTrappedFailValidation():
    grid = numpy.zeros((3, 3), str)
    grid[0][0] = 'U'
    grid[0][1] = 'S'
    grid[1][0] = 'S'
    grid[1][1] = 'T'
    assert (gridbuild.validateGrid(grid)) == False
Beispiel #3
0
def testGridSuccessValidation():
    grid = numpy.zeros((3, 3), str)
    grid[0][0] = 'U'
    grid[0][1] = 'S'
    grid[1][1] = 'S'
    grid[2][2] = 'T'
    assert (gridbuild.validateGrid(grid)) == True
Beispiel #4
0
def testGridTreasurePitTrappedFailValidation():
    grid = numpy.zeros((3, 3), str)
    grid[0][0] = 'T'
    grid[0][1] = 'P'
    grid[1][0] = 'P'
    grid[1][1] = 'U'
    assert (gridbuild.validateGrid(grid)) == False
Beispiel #5
0
def testGridUserTrappedWithoutStreamFailValidation():
    grid = numpy.zeros((3, 3), str)
    grid[0][0] = 'U'
    grid[0][2] = 'S'
    grid[1][0] = 'S'
    grid[1][1] = 'S'
    grid[2][2] = 'T'
    assert (gridbuild.validateGrid(grid)) == False
Beispiel #6
0
def testGridUserTrappedWithStreamSuccessValidation():
    grid = numpy.zeros((3, 3), str)
    grid[0][0] = 'U'
    grid[0][2] = 'S'
    grid[1][0] = 'S'
    grid[1][1] = 'S'
    grid[2][2] = 'T'
    grid[0][1] = '1'
    grid[2][1] = '1'
    assert (gridbuild.validateGrid(grid)) == True