from tests import BaseTestCase
import unittest


class TestDrawing(BaseTestCase):

    """
    Test container of plan
    """

    @classmethod
    def setUpClass(cls):
        from planner.drawing import Drawing
        cls.Drawing = Drawing

    def setUp(self):
        self.drawing = self.Drawing()

    def test_format_sizes(self):
        """
        Check that specified format sizes are confined
        """
        drawing = self.Drawing("A3")
        self.assertSequenceEqual(drawing.size, (420, 297))
        drawing = self.Drawing("A2")
        self.assertSequenceEqual(drawing.size, (594, 420))
        drawing = self.Drawing("A4")
        self.assertSequenceEqual(drawing.size, (297, 210))

    @unittest.skip("Not implemented")
    def test_add(self):
        pass

    @unittest.skip("Not implemented")
    def test_render(self):
        pass

@@ -706,41 +706,238 @@
     
-@unittest.skip(%22Not implemented%22)
+def test_add(self):%0A        %22%22%22%0A        Test adding objects to drawing%0A        %22%22%22%0A        from planner.frame import Frame%0A        frame = Frame()%0A        self.drawing.add(frame)%0A        self.assertIn(frame, self.drawing.objects)%0A
 %0A   
@@ -938,35 +938,38 @@
 )%0A%0A    def test_
-add
+render
 (self):%0A        
@@ -972,88 +972,554 @@
     
-pass%0A%0A    @unittest.skip(%22Not implemented%22)%0A    def test_render(self):%0A        pass
+%22%22%22%0A        Check that rendered code contained code of every drawing element%0A        %22%22%22%0A        from planner.frame import Frame%0A        frame = Frame()%0A        rect = frame.add_rect()%0A        rect_frame = frame.add_rect_frame()%0A        self.drawing.add(frame)%0A        frame2 = Frame()%0A        rect2 = frame2.add_rect(x=10, y=10)%0A        self.drawing.add(frame2)%0A        rendered = str(self.drawing)%0A        for element in %5Brect, rect_frame, rect2%5D:%0A            for shape in element._draw():%0A                self.assertIn(shape.tostring(), rendered)
 %0A

complete Drawing tests