Esempio n. 1
0
 def test_not_create_splines(self):
     upload_topographical_file("test/Example_topographic_2.txt")
     dwg2 = ezdxf.new('AC1018')
     msp2 = dwg2.modelspace()
     create_curves(msp2, get_curves(), file_user)
     n = 0
     for a in msp2:
         if a.dxftype() == 'SPLINE':
             n = n + 1
     self.assertEqual(n, 0, FAILURE)
Esempio n. 2
0
 def test_number_lines_topographical_file_empty(self):
     upload_topographical_file("test/Example_topographic_3.txt")
     self.assertEqual(len(get_points()), 0, FAILURE)
     self.assertNotEqual(len(get_points()), 5, FAILURE)
Esempio n. 3
0
             ['RE', 'Red_Electrica', (0, 0, 0)],
             ['SAN', 'Saneamiento', (111, 127, 63)], ['M', 'Muro', (0, 0, 0)],
             ['B', 'Bordillo', (0, 0, 0)], ['R', 'Relleno', (0, 0, 0)],
             ['ARB', 'Arbol', (0, 0, 0)], ['C', 'Calzada', (111, 127, 63)]]

# Created layers
layers = [
    'Edificio', 'Acera', 'Farola', 'Telecomunicaciones', 'Red_Electrica',
    'Saneamiento', 'Muro', 'Bordillo', 'Relleno', 'Arbol', 'Calzada', 'Points',
    'Number_Points', 'Altitude', 'Label', '0', 'Defpoints', 'View Port'
]

dwg = ezdxf.new('AC1018')
msp = dwg.modelspace()
create_layers(dwg, file_user)
upload_topographical_file("test/Example_topographic_1.txt")


class SurveyingPointCode(unittest.TestCase):
    def test_create_layers_number(self):
        self.assertEqual(len(dwg.layers), 18, FAILURE)
        self.assertNotEqual(len(dwg.layers), 10, FAILURE)

    def test_create_layers_types(self):
        for layer in dwg.layers:
            self.assertIn(layer.dxf.name, layers, FAILURE)

    def test_create_points_number_file_correct(self):
        create_points(dwg, msp, get_points())
        n_points = len(get_points())
        n = 0