# Path: tilenol/xcb/core.py
# class Rectangle(namedtuple('_Rectangle', 'x y width height')):
#     __slots__ = ()


import unittest
    import mock
    from unittest import mock  # builtin mock in 3.3
from tilenol.xcb import Rectangle
        from tilenol.layout.examples import Tile
        from tilenol.layout import Split, Stack, TileStack
        from tilenol.layout import Split, Stack, TileStack
try:
except ImportError:


class Window(object):

    def set_bounds(self, rect):
        assert isinstance(rect, Rectangle)
        self.rect = rect


class TestTile(unittest.TestCase):

    def wmock(self):
        w = mock.Mock()
        w.lprops.stack = None
        return w

    @mock.patch('tilenol.event.Event')
    def testTile(self, event):
        lay = Tile()
        lay.set_bounds(Rectangle(0, 0, 800, 600))
        w1 = self.wmock()
        lay.add(w1)
        lay.layout()
        w1.set_bounds.assert_called_with(Rectangle(0, 0, 800, 600))
        w1.reset_mock()
        w2 = self.wmock()

# Path: tilenol/xcb/core.py
# class Rectangle(namedtuple('_Rectangle', 'x y width height')):
#     __slots__ = ()


# Path: tests/layouts/test_tile.py
import unittest
    import mock
    from unittest import mock  # builtin mock in 3.3
from tilenol.xcb import Rectangle
        from tilenol.layout.examples import Tile
        from tilenol.layout import Split, Stack, TileStack
        from tilenol.layout import Split, Stack, TileStack

try:
except ImportError:


class Window(object):

    def set_bounds(self, rect):
        assert isinstance(rect, Rectangle)
        self.rect = rect


class TestTile(unittest.TestCase):

    def wmock(self):
        w = mock.Mock()
        w.lprops.stack = None
        return w

    @mock.patch('tilenol.event.Event')
    def testTile(self, event):
        lay = Tile()
        lay.set_bounds(Rectangle(0, 0, 800, 600))
        w1 = self.wmock()
        lay.add(w1)
        lay.layout()
        w1.set_bounds.assert_called_with(Rectangle(0, 0, 800, 600))
        w1.reset_mock()
        w2 = self.wmock()

        lay.add(w2)