Exemple #1
0
    def test_start_location(self):
        import skb.model as model
        from skb.model.game import ShiftyBoard

        sb = ShiftyBoard()

        sb.name = 'test_start_location'
        sb.dimensions = (3,3)
        sb.start_location = (1,1)

        model.commit()

        sb = ShiftyBoard.query.get(name='test_start_location')

        assert sb.start_location == (1,1)

        with self.assertRaises(Exception):
            assert sb.start_location == (-1,-1)

        with self.assertRaises(Exception):
            assert sb.start_location == (3,3)