| 143 | |
| 144 | |
| 145 | def test_option_match(): |
| 146 | assert Option('-a').match([Option('-a', value=True)]) == \ |
| 147 | (True, [], [Option('-a', value=True)]) |
| 148 | assert Option('-a').match([Option('-x')]) == (False, [Option('-x')], []) |
| 149 | assert Option('-a').match([Argument('N')]) == (False, [Argument('N')], []) |
| 150 | assert Option('-a').match([Option('-x'), Option('-a'), Argument('N')]) == \ |
| 151 | (True, [Option('-x'), Argument('N')], [Option('-a')]) |
| 152 | assert Option('-a').match([Option('-a', value=True), Option('-a')]) == \ |
| 153 | (True, [Option('-a')], [Option('-a', value=True)]) |
| 154 | |
| 155 | |
| 156 | def test_argument_match(): |