You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
366 B
12 lines
366 B
import pygame as pg
|
|
import pytest
|
|
from ship import Ship
|
|
|
|
def test_ship_constructor():
|
|
scr_rect = pg.Rect(0,0,100,100)
|
|
a_ship = Ship((10+Ship.SIZE/2, 20+Ship.SIZE/2), scr_rect)
|
|
assert a_ship.rect.centerx == scr_rect.centerx
|
|
assert a_ship.rect.centery == scr_rect.centery
|
|
assert a_ship.map_rect.left == 10+1
|
|
assert a_ship.map_rect.top == 20+1
|
|
|
|
|