示例#1
0
 def test_02_Message(self):
     """ No payload (not too useful)
     """
     l_message = Util._make_message(self.m_pyhouse_obj)
     #  print(PrettyFormatAny.form(l_message, 'Bare Message', 80))
     self.assertEqual(self.jsonPair(l_message, 'Sender'), self.m_pyhouse_obj.Computer.Name)
     self.assertSubstring('DateTime', l_message)
示例#2
0
 def test_02_Message(self):
     """ No payload (not too useful)
     """
     l_message = Util._make_message(self.m_pyhouse_obj)
     #  print(PrettyFormatAny.form(l_message, 'Bare Message', 80))
     self.assertEqual(self.jsonPair(l_message, 'Sender'),
                      self.m_pyhouse_obj.Computer.Name)
     self.assertSubstring('DateTime', l_message)
示例#3
0
 def test_03_MessageObj(self):
     """ Add an object.
     """
     l_data = ScheduleLightData()
     l_data.Name = 'Mqtt Controller Object'
     l_data.RoomName = 'Living Room'
     l_data.Comment = 'The formal Living Room.'
     l_message = Util._make_message(self.m_pyhouse_obj, l_data)
     #  print(PrettyFormatAny.form(l_message, 'Message', 80))
     self.assertEqual(self.jsonPair(l_message, 'Sender'), self.m_pyhouse_obj.Computer.Name)
     self.assertSubstring('DateTime', l_message)
     self.assertEqual(self.jsonPair(l_message, 'Name'), l_data.Name)
示例#4
0
 def test_03_MessageObj(self):
     """ Add an object.
     """
     l_data = ScheduleLightData()
     l_data.Name = 'Mqtt Controller Object'
     l_data.RoomName = 'Living Room'
     l_data.Comment = 'The formal Living Room.'
     l_message = Util._make_message(self.m_pyhouse_obj, l_data)
     #  print(PrettyFormatAny.form(l_message, 'Message', 80))
     self.assertEqual(self.jsonPair(l_message, 'Sender'),
                      self.m_pyhouse_obj.Computer.Name)
     self.assertSubstring('DateTime', l_message)
     self.assertEqual(self.jsonPair(l_message, 'Name'), l_data.Name)
示例#5
0
 def test_01_Topic(self):
     """ Test topic.
     """
     l_topic = Util._make_topic(self.m_pyhouse_obj, 'Test')
     self.assertEqual(l_topic, "pyhouse/test_house/Test")
示例#6
0
 def test_01_Topic(self):
     """ Test topic.
     """
     l_topic = Util._make_topic(self.m_pyhouse_obj, 'Test')
     self.assertEqual(l_topic, "pyhouse/test_house/Test")