| Total Complexity | 5 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | """Test the accumulation of operations with Option objects.""" |
||
| 13 | class TestAccumulateOption00(unittest.TestCase): |
||
| 14 | """Accumulate a Option operation.""" |
||
| 15 | |||
| 16 | def setUp(self): |
||
| 17 | self.operation = copy.deepcopy(OPTION_OPERATION3) |
||
| 18 | self.accumulator = Accumulator(OPTION1) |
||
| 19 | self.accumulator.accumulate(self.operation) |
||
| 20 | |||
| 21 | def test_returned_result(self): |
||
| 22 | """Check the results of the operation.""" |
||
| 23 | self.assertEqual(self.operation.results, {}) |
||
| 24 | |||
| 25 | def test_accumulator_price(self): |
||
| 26 | """Check the cost of the option on the accumulator.""" |
||
| 27 | self.assertEqual(self.accumulator.state['price'], 10) |
||
| 28 | |||
| 29 | def test_accumulator_quantity(self): |
||
| 30 | """Check the quantity of the option on the accumulator.""" |
||
| 31 | self.assertEqual(self.accumulator.state['quantity'], 100) |
||
| 32 | |||
| 33 | def test_accumulator_results(self): |
||
| 34 | """Check the results of the option on the accumulator.""" |
||
| 35 | self.assertEqual(self.accumulator.state['results'], {}) |
||
| 36 |