Exemple #1
0
 def test_Sublists(self):
     atoms = DXFList([
         DXFList([ 
             DXFAtom('TAG1'),
             DXFAtom('TAG2'),
             DXFList([ 
                 DXFAtom('TAG14'),
                 DXFAtom('TAG15'),
                 DXFAtom('TAG16'),
             ]),                
             DXFAtom('TAG3'),
         ]),
         DXFList([ 
             DXFAtom('TAG4'),
             DXFAtom('TAG5'),
             DXFAtom('TAG6'),
             DXFList([ 
                 DXFAtom('TAG11'),
                 DXFAtom('TAG12'),
                 DXFAtom('TAG13'),
             ]),                
         ]),
         DXFAtom('TAG7'),
     ])
     self.assertEqual(dxfstr(atoms), tags2str(atoms))
Exemple #2
0
 def test_Sublists(self):
     atoms = DXFList([
         DXFList([
             DXFAtom('TAG1'),
             DXFAtom('TAG2'),
             DXFList([
                 DXFAtom('TAG14'),
                 DXFAtom('TAG15'),
                 DXFAtom('TAG16'),
             ]),
             DXFAtom('TAG3'),
         ]),
         DXFList([
             DXFAtom('TAG4'),
             DXFAtom('TAG5'),
             DXFAtom('TAG6'),
             DXFList([
                 DXFAtom('TAG11'),
                 DXFAtom('TAG12'),
                 DXFAtom('TAG13'),
             ]),
         ]),
         DXFAtom('TAG7'),
     ])
     self.assertEqual(dxfstr(atoms), tags2str(atoms))
Exemple #3
0
 def test_flat_DXFList(self):
     atoms = DXFList()
     atoms.append(DXFAtom('HEADER'))
     atoms.append(DXFAtom('SECTION', 1))
     self.assertEqual(dxfstr(atoms), '  0\nHEADER\n  1\nSECTION\n')
     result = tags2str(atoms)
     self.assertEqual(dxfstr(atoms), result)
Exemple #4
0
 def test_flat_DXFList(self):
     atoms = DXFList()
     atoms.append(DXFAtom('HEADER'))
     atoms.append(DXFAtom('SECTION', 1))
     self.assertEqual(dxfstr(atoms), '  0\nHEADER\n  1\nSECTION\n')
     result = tags2str(atoms)
     self.assertEqual(dxfstr(atoms), result)
Exemple #5
0
 def test_empty_DXFList(self):
     atoms = DXFList()
     self.assertEqual(dxfstr(atoms), '')
     self.assertEqual(dxfstr(atoms), tags2str(atoms))
Exemple #6
0
 def test_group_code_1000(self):    
     atom = DXFAtom ('SECTION', 1000)
     self.assertEqual(dxfstr(atom), '1000\nSECTION\n')
     self.assertEqual(dxfstr(atom), tags2str(atom))
Exemple #7
0
 def test_group_code_0(self):
     atom = DXFAtom('HEADER', 0)
     self.assertEqual(dxfstr(atom), '  0\nHEADER\n')
     self.assertEqual(dxfstr(atom), tags2str(atom))
Exemple #8
0
 def test_empty_DXFList(self):
     atoms = DXFList()
     self.assertEqual(dxfstr(atoms), '')
     self.assertEqual(dxfstr(atoms), tags2str(atoms))
Exemple #9
0
 def test_group_code_1000(self):
     atom = DXFAtom('SECTION', 1000)
     self.assertEqual(dxfstr(atom), '1000\nSECTION\n')
     self.assertEqual(dxfstr(atom), tags2str(atom))
Exemple #10
0
 def test_group_code_0(self):
     atom = DXFAtom('HEADER', 0)
     self.assertEqual(dxfstr(atom), '  0\nHEADER\n')
     self.assertEqual(dxfstr(atom), tags2str(atom))