コード例 #1
0
 def test_empty_section(self):
     section = ObjectsSection(Tags.from_text(EMPTYSEC), self.dwg)
     stream = StringIO()
     section.write(stream)
     result = stream.getvalue()
     stream.close()
     self.assertEqual(EMPTYSEC, result)
コード例 #2
0
ファイル: test_objectssection.py プロジェクト: csachs/ezdxf
def test_empty_section():
    ent = load_section(EMPTYSEC, 'OBJECTS')
    dwg = DrawingProxy('AC1015')
    section = ObjectsSection(ent, dwg)
    stream = StringIO()
    section.write(TagWriter(stream))
    result = stream.getvalue()
    stream.close()
    assert EMPTYSEC == result
コード例 #3
0
def test_empty_section():
    ent = load_section(EMPTYSEC, 'OBJECTS')
    dwg = ezdxf.new('R2000')
    section = ObjectsSection(ent, dwg)
    stream = StringIO()
    section.write(TagWriter(stream))
    result = stream.getvalue()
    stream.close()
    assert EMPTYSEC == result
コード例 #4
0
class TestObjectsSection(unittest.TestCase):
    def setUp(self):
        self.dwg = DrawingProxy('AC1015')
        self.section = ObjectsSection(Tags.from_text(TESTOBJECTS), self.dwg)

    def test_write(self):
        stream = StringIO()
        self.section.write(stream)
        result = stream.getvalue()
        stream.close()
        self.assertEqual(normlines(TESTOBJECTS), normlines(result))

    def test_empty_section(self):
        section = ObjectsSection(Tags.from_text(EMPTYSEC), self.dwg)
        stream = StringIO()
        section.write(stream)
        result = stream.getvalue()
        stream.close()
        self.assertEqual(EMPTYSEC, result)