def test_merge_aes(self): layer1 = rplot.Layer(size=rplot.ScaleSize('test')) layer2 = rplot.Layer(shape=rplot.ScaleShape('test')) rplot.merge_aes(layer1, layer2) self.assertTrue(isinstance(layer2.aes['size'], rplot.ScaleSize)) self.assertTrue(isinstance(layer2.aes['shape'], rplot.ScaleShape)) self.assertTrue(layer2.aes['size'] == layer1.aes['size']) for key in list(layer2.aes.keys()): if key != 'size' and key != 'shape': self.assertTrue(layer2.aes[key] is None)
def test_merge_aes(self): layer1 = rplot.Layer(size=rplot.ScaleSize('test')) layer2 = rplot.Layer(shape=rplot.ScaleShape('test')) rplot.merge_aes(layer1, layer2) self.assertTrue(isinstance(layer2.aes['size'], rplot.ScaleSize)) self.assertTrue(isinstance(layer2.aes['shape'], rplot.ScaleShape)) self.assertEqual(layer2.aes['size'], layer1.aes['size']) for key in layer2.aes.keys(): if key != 'size' and key != 'shape': self.assertTrue(layer2.aes[key] is None)