Exemplo n.º 1
0
    def layer(name, **kwargs):
        """ Create a new layer.

        :param str name: layer name
        :param int flags: standard flag values, bit-coded, default=0
        :param int color: color number, negative if layer is off, default=1
        :param str linetype: linetype name, default="CONTINUOUS"

        """
        return Layer(name, **kwargs)
 def test_layer_thaw(self):
     layer = Layer('Standard', flags=const.STD_FLAGS_LAYER_FROZEN)
     layer.thaw()
     self.assertEqual(layer['flags'], 0)
 def test_layer_freeze(self):
     layer = Layer('Standard', flags=0)
     layer.freeze()
     self.assertEqual(layer['flags'], const.STD_FLAGS_LAYER_FROZEN)
 def test_layer_unlock(self):
     layer = Layer('Standard', flags=const.STD_FLAGS_LAYER_LOCKED)
     layer.unlock()
     self.assertEqual(layer['flags'], 0)
 def test_layer_off_off(self):
     layer = Layer('Standard', flags=0, color=-7)
     layer.off()
     self.assertEqual(layer['color'], -7)
 def test_layer_on_on(self):
     layer = Layer('Standard', flags=0, color=7)
     layer.on()
     self.assertEqual(layer['color'], 7)
 def test_create_table_entry(self):
     layer = Layer('Standard', linetype='CONTINUOUS')
     self.assertEqual(dxfstr(layer), self.expected)
Exemplo n.º 8
0
 def test_layer_thaw(self):
     layer = Layer('Standard', flags=const.STD_FLAGS_LAYER_FROZEN)
     layer.thaw()
     self.assertEqual(layer['flags'], 0)
Exemplo n.º 9
0
 def test_layer_freeze(self):
     layer = Layer('Standard', flags=0)
     layer.freeze()
     self.assertEqual(layer['flags'], const.STD_FLAGS_LAYER_FROZEN)
Exemplo n.º 10
0
 def test_layer_unlock(self):
     layer = Layer('Standard', flags=const.STD_FLAGS_LAYER_LOCKED)
     layer.unlock()
     self.assertEqual(layer['flags'], 0)
Exemplo n.º 11
0
 def test_layer_off_off(self):
     layer = Layer('Standard', flags=0, color=-7)
     layer.off()
     self.assertEqual(layer['color'], -7)
Exemplo n.º 12
0
 def test_layer_on_on(self):
     layer = Layer('Standard', flags=0, color=7)
     layer.on()
     self.assertEqual(layer['color'], 7)