Exemple #1
0
 def test_dial_units(self):
     test_control = Dial("DIALID", units='Watts')
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['units'], 'Watts',
                      "CFG units should be 'Watts'")
Exemple #2
0
 def test_dial_style(self):
     test_control = Dial("DIALID", style=DialStyle.BAR)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['style'], 'bar', "CFG style should be 'bar'")
Exemple #3
0
 def test_dial_precision(self):
     test_control = Dial("DIALID", precision=Precision.FIVE)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['precision'], 5, "CFG precision should be 5")
Exemple #4
0
 def test_dial_pointer_color(self):
     test_control = Dial("DIALID", pointer_color=Color.AZURE)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['pointerColor'], '136',
                      "CFG pointerColor should be '136'")
Exemple #5
0
 def test_dial_number_position(self):
     test_control = Dial("DIALID", number_position=DialNumberPosition.LEFT)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['numberPosition'], 'left',
                      "CFG numberPosition should be 'left'")
Exemple #6
0
 def test_dial_dial_fill_color(self):
     test_control = Dial("DIALID", dial_fill_color=Color.WHEAT)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['dialFillColor'], '110',
                      "CFG dialFillColor should be '110'")
Exemple #7
0
 def test_dial_show_min_max(self):
     test_control = Dial("DIALID", show_min_max=True)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['showMinMax'], True,
                      "CFG showMinMax should be True")
Exemple #8
0
 def test_dial_red_value(self):
     test_control = Dial("DIALID", red_value=50)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['redValue'], 50, "CFG redValue should be 50")
Exemple #9
0
 def test_dial_max(self):
     test_control = Dial("DIALID", dial_max=1)
     cfg_dict = self._get_cfg_dict(test_control.get_cfg(1))
     self.assertEqual(cfg_dict['max'], 1, "CFG min should be 1")
Exemple #10
0
 def test_dial(self):
     test_control = Dial("DIALID")
     test_control.dial_value = 1
     self.assertEqual(test_control.get_state(),
                      '\t{device_id}\tDIAL\tDIALID\t1\n', "Should be 1")