コード例 #1
0
    def test_initalize_dictionary_with_value_of_10(self):

        max = MaxValue()
        value = 10
        return_value, data, steps = max.step(value, self.data, self.steps)
        self.assertDictEqual(data, self.data)
        self.assertListEqual(steps, self.steps)
        self.assertEqual(return_value, value)
        self.assertEqual(max.max_value[self.device][self.port], value)
コード例 #2
0
    def test_leave_max_value_at_10(self):

        max = MaxValue()
        value = 10
        return_value, data, steps = max.step(value, self.data, self.steps)
        self.assertDictEqual(data, self.data)
        self.assertListEqual(steps, self.steps)
        self.assertEqual(return_value, value)
        self.assertEqual(max.max_value[self.device][self.port], value)

        value = 5
        return_value, data, steps = max.step(value, self.data, self.steps)
        self.assertDictEqual(data, self.data)
        self.assertListEqual(steps, self.steps)
        self.assertEqual(return_value, value)
        self.assertEqual(max.max_value[self.device][self.port], 10)
コード例 #3
0
    def test_initalize_dictionary_with_added_port_to_value_of_11(self):

        max = MaxValue()
        value = 10
        return_value, data, steps = max.step(value, self.data, self.steps)
        self.assertDictEqual(data, self.data)
        self.assertListEqual(steps, self.steps)
        self.assertEqual(return_value, value)
        self.assertEqual(max.max_value[self.device][self.port], value)

        max = MaxValue()
        value = 11
        self.data['port'] = 'port1'
        return_value, data, steps = max.step(value, self.data, self.steps)
        self.assertDictEqual(data, self.data)
        self.assertListEqual(steps, self.steps)
        self.assertEqual(return_value, value)
        self.assertEqual(max.max_value[self.device][self.port], 10)
        self.assertEqual(max.max_value[self.device]['port1'], value)
コード例 #4
0
 def test_logger_name(self):
     max = MaxValue()
     self.assertEqual(max.logger_name, Constants.LogKeys.steps)
コード例 #5
0
 def test_topic_name(self):
     max = MaxValue()
     self.assertEqual(max.topic_name, Constants.TopicNames.MaxValue)