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)