Exemplo n.º 1
0
    def test_gen_frequency_info(self):
        """Test gen_scaling_info."""
        channel_info = types.ChartAxis(name='D0',
                                       channels=[pulse.DriveChannel(0)])

        obj = chart.gen_channel_freqs(channel_info,
                                      formatter=self.formatter,
                                      device=self.device)[0]

        # type check
        self.assertEqual(type(obj), drawings.TextData)

        # data check
        self.assertListEqual(obj.channels, [pulse.DriveChannel(0)])
        self.assertEqual(obj.text, '5.00 GHz')

        # style check
        ref_style = {
            'zorder': self.formatter['layer.axis_label'],
            'color': self.formatter['color.axis_label'],
            'size': self.formatter['text_size.annotate'],
            'va': 'center',
            'ha': 'right'
        }
        self.assertDictEqual(obj.styles, ref_style)
Exemplo n.º 2
0
    def test_gen_frequency_info(self):
        """Test gen_scaling_info."""
        channel_info = types.ChartAxis(name="D0",
                                       channels=[pulse.DriveChannel(0)])

        obj = chart.gen_channel_freqs(channel_info,
                                      formatter=self.formatter,
                                      device=self.device)[0]

        # type check
        self.assertEqual(type(obj), drawings.TextData)

        # data check
        self.assertListEqual(obj.channels, [pulse.DriveChannel(0)])
        self.assertEqual(obj.text, "5.00 GHz")

        # style check
        ref_style = {
            "zorder": self.formatter["layer.axis_label"],
            "color": self.formatter["color.axis_label"],
            "size": self.formatter["text_size.annotate"],
            "va": "center",
            "ha": "right",
        }
        self.assertDictEqual(obj.styles, ref_style)