| 348 | self.is_continued = False |
| 349 | |
| 350 | def side_effect(msg, **kwargs): |
| 351 | if re.match(r"^~~~ Would you like to add another item to.*", msg): |
| 352 | # prompt requires the input to judge continuing setting, or not |
| 353 | if not self.is_continued: |
| 354 | # continuing the configuration only once |
| 355 | self.is_continued = True |
| 356 | return "" |
| 357 | else: |
| 358 | # finishing to configuration |
| 359 | return "n" |
| 360 | else: |
| 361 | # prompt requires the input of property value in the object |
| 362 | return "value" |
| 363 | |
| 364 | prompt_mock.side_effect = side_effect |
| 365 | results = Reader.read() |