@@ -354,7 +354,7 @@ def test_cell_neighborhood():
354
354
grid = HexGrid (
355
355
(width , height ), torus = False , capacity = None , random = random .Random (42 )
356
356
)
357
- for radius , n in zip (range (1 , 4 ), [2 , 6 , 11 ]):
357
+ for radius , n in zip (range (1 , 4 ), [3 , 7 , 13 ]):
358
358
if radius == 1 :
359
359
neighborhood = grid ._cells [(0 , 0 )].neighborhood
360
360
else :
@@ -366,7 +366,7 @@ def test_cell_neighborhood():
366
366
grid = HexGrid (
367
367
(width , height ), torus = False , capacity = None , random = random .Random (42 )
368
368
)
369
- for radius , n in zip (range (1 , 4 ), [5 , 10 , 17 ]):
369
+ for radius , n in zip (range (1 , 4 ), [4 , 10 , 17 ]):
370
370
if radius == 1 :
371
371
neighborhood = grid ._cells [(1 , 0 )].neighborhood
372
372
else :
@@ -385,35 +385,35 @@ def test_hexgrid():
385
385
assert len (grid ._cells ) == width * height
386
386
387
387
# first row
388
- assert len (grid ._cells [(0 , 0 )].connections .values ()) == 2
388
+ assert len (grid ._cells [(0 , 0 )].connections .values ()) == 3
389
389
for connection in grid ._cells [(0 , 0 )].connections .values ():
390
- assert connection .coordinate in {(0 , 1 ), (1 , 0 )}
390
+ assert connection .coordinate in {(0 , 1 ), (1 , 0 ), ( 1 , 1 ) }
391
391
392
392
# second row
393
- assert len (grid ._cells [(1 , 0 )].connections .values ()) == 5
393
+ assert len (grid ._cells [(1 , 0 )].connections .values ()) == 4
394
394
for connection in grid ._cells [(1 , 0 )].connections .values ():
395
395
# fmt: off
396
- assert connection .coordinate in {( 0 , 0 ), (0 , 1 ),
397
- (1 , 1 ),
398
- ( 2 , 0 ), ( 2 , 1 )}
396
+ assert connection .coordinate in { ( 1 , 1 ), (2 , 1 ),
397
+ (0 , 0 ), ( 2 , 0 ),}
398
+ # fmt: on
399
399
400
400
# middle odd row
401
401
assert len (grid ._cells [(5 , 5 )].connections .values ()) == 6
402
402
for connection in grid ._cells [(5 , 5 )].connections .values ():
403
403
# fmt: off
404
- assert connection .coordinate in {(4 , 5 ), (4 , 6 ),
405
- (5 , 4 ), (5 , 6 ),
406
- (6 , 5 ), (6 , 6 )}
404
+ assert connection .coordinate in { (4 , 4 ), (5 , 4 ),
405
+ (4 , 5 ), (6 , 5 ),
406
+ (4 , 6 ), (5 , 6 )}
407
407
408
408
# fmt: on
409
409
410
410
# middle even row
411
411
assert len (grid ._cells [(4 , 4 )].connections .values ()) == 6
412
412
for connection in grid ._cells [(4 , 4 )].connections .values ():
413
413
# fmt: off
414
- assert connection .coordinate in {(3 , 3 ), (3 , 4 ),
415
- (4 , 3 ), (4 , 5 ),
416
- (5 , 3 ), (5 , 4 )}
414
+ assert connection .coordinate in {(4 , 3 ), (5 , 3 ),
415
+ (3 , 4 ), (5 , 4 ),
416
+ (4 , 5 ), (5 , 5 )}
417
417
418
418
# fmt: on
419
419
@@ -424,9 +424,9 @@ def test_hexgrid():
424
424
assert len (grid ._cells [(0 , 0 )].connections .values ()) == 6
425
425
for connection in grid ._cells [(0 , 0 )].connections .values ():
426
426
# fmt: off
427
- assert connection .coordinate in {(9 , 9 ), (9 , 0 ),
428
- (0 , 9 ), (0 , 1 ),
429
- (1 , 9 ), (1 , 0 )}
427
+ assert connection .coordinate in {(0 , 9 ), (1 , 9 ),
428
+ (9 , 0 ), (1 , 0 ),
429
+ (0 , 1 ), (1 , 1 )}
430
430
431
431
# fmt: on
432
432
0 commit comments