def test_basic(self): from pggame import PGGame tiles = PGTile.objects.all() game = PGGame.create("Test for PGDeal") deal = PGDeal.create(tiles, game, 0) self.assertIsNone(deal.tile(-1)) for i in range(32): self.assertIsNotNone(deal.tile(i)) self.assertIsNone(deal.tile(32))
def test_basic( self ): from pggame import PGGame tiles = PGTile.objects.all() game = PGGame.create( "Test for PGDeal" ) deal = PGDeal.create( tiles, game, 0 ) self.assertIsNone( deal.tile( -1 ) ) for i in range(32): self.assertIsNotNone( deal.tile( i ) ) self.assertIsNone( deal.tile( 32 ) )
def test_save_get(self): from pggame import PGGame from pgtile import PGTile game = PGGame.create('test for deal') game.save() tiles = PGTile.objects.all() deal = PGDeal.create(tiles, game, 1) deal.save() deal = PGDeal.objects.filter(game=game, deal_number=1) self.assertIsNotNone(deal)
def test_save_get( self ): from pggame import PGGame from pgtile import PGTile game = PGGame.create( 'test for deal' ) game.save() tiles = PGTile.objects.all() deal = PGDeal.create( tiles, game, 1 ) deal.save() deal = PGDeal.objects.filter( game = game, deal_number = 1 ) self.assertIsNotNone( deal )
def test_get_tiles(self): from pggame import PGGame from pgtile import PGTile game = PGGame.create('test for deal') game.save() tiles = PGTile.objects.all() deal = PGDeal.create(tiles, game, 1) deal.save() deals = PGDeal.objects.filter(game=game, deal_number=1) self.assertEqual(len(deals), 1) for i in range(32): self.assertIsNotNone(deals[0].tile(i))
def test_get_tiles( self ): from pggame import PGGame from pgtile import PGTile game = PGGame.create( 'test for deal' ) game.save() tiles = PGTile.objects.all() deal = PGDeal.create( tiles, game, 1 ) deal.save() deals = PGDeal.objects.filter( game = game, deal_number = 1 ) self.assertEqual( len(deals), 1 ) for i in range(32): self.assertIsNotNone( deals[0].tile(i) )