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)
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)
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)