def test_05_Message(self): """ No payload (not too useful) """ l_message = mqtt._make_message(self.m_pyhouse_obj) # print(PrettyFormatAny.form(l_message, 'B1-05-A - Bare Message', 80)) self.assertEqual(self.jsonPair(l_message, 'Sender'), self.m_pyhouse_obj.Computer.Name) self.assertSubstring('DateTime', l_message)
def test_06_MessageObj(self): """ Add an object. """ l_data = ScheduleLightInformation() l_data.Name = 'Mqtt Controller Object' l_data.RoomName = 'Living Room' l_data.Comment = 'The formal Living Room.' l_message = mqtt._make_message(self.m_pyhouse_obj, l_data) # print(PrettyFormatAny.form(l_message, 'C2-03-A - 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)
def test_04_Msg(self): _l_msg = mqtt._make_message(self.m_pyhouse_obj, DICT)
def test_03_Msg(self): _l_msg = mqtt._make_message(self.m_pyhouse_obj, self.m_pyhouse_obj.House)