()
| 149 | |
| 150 | |
| 151 | def test_multivar() -> None: |
| 152 | with open(CONFIG_FILENAME, 'w') as new_file: |
| 153 | new_file.write('[this]\n\tthat = foobar\n\tthat = foobeer\n') |
| 154 | |
| 155 | config = Config() |
| 156 | config.add_file(CONFIG_FILENAME, 6) |
| 157 | assert 'this.that' in config |
| 158 | |
| 159 | assert ['foobar', 'foobeer'] == list(config.get_multivar('this.that')) |
| 160 | assert ['foobar'] == list(config.get_multivar('this.that', 'bar')) |
| 161 | assert ['foobar', 'foobeer'] == list(config.get_multivar('this.that', 'foo.*')) |
| 162 | |
| 163 | config.set_multivar('this.that', '^.*beer', 'fool') |
| 164 | assert ['fool'] == list(config.get_multivar('this.that', 'fool')) |
| 165 | |
| 166 | config.set_multivar('this.that', 'foo.*', 'foo-123456') |
| 167 | assert ['foo-123456', 'foo-123456'] == list( |
| 168 | config.get_multivar('this.that', 'foo.*') |
| 169 | ) |
| 170 | |
| 171 | config.delete_multivar('this.that', 'bar') |
| 172 | assert ['foo-123456', 'foo-123456'] == list(config.get_multivar('this.that', '')) |
| 173 | |
| 174 | config.delete_multivar('this.that', 'foo-[0-9]+') |
| 175 | assert [] == list(config.get_multivar('this.that', '')) |
| 176 | |
| 177 | |
| 178 | def test_iterator(config: Config) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…