bugwarrior icon indicating copy to clipboard operation
bugwarrior copied to clipboard

Easier Per-Service Configuration Testing

Open ryneeverett opened this issue 2 years ago • 0 comments

Per https://github.com/ralphbean/bugwarrior/pull/954#issuecomment-1228110944, we could make it simpler and more straightforward to test different service configuration values if we replaced our per-service self.config definition with some magic in the base class that allowed for better ergonomics, e.g.:

def test_filter_repos_include(self):
    self.service.config['deck.include_board_ids'] = ['5']
    self.assertTrue(self.service.filter_repos({'title': 'testboard', 'id': 5}))
    self.assertFalse(self.service.filter_repos({'title': 'testboard', 'id': 6}))

def test_filter_repos_exclude(self):
    self.service.config['deck.exclude_board_ids'] = ['5']
    self.assertFalse(self.service.filter_repos({'title': 'testboard', 'id': 5}))
    self.assertTrue(self.service.filter_repos({'title': 'testboard', 'id': 6}))

It may or may not make sense to put config in the top level namespace instead of within service.

ryneeverett avatar Sep 01 '22 17:09 ryneeverett