def test_finds_first_match(self): drivers = [ { "modaliases": ["foo*"], "comment": "first" }, { "modaliases": ["foo*"], "comment": "notfirst" }, ] aliases = ["foobar"] driver = match_aliases_to_driver(aliases, drivers) self.assertEqual(drivers[0], driver)
def test_finds_first_match(self): drivers = [ { 'modaliases': ['foo*'], 'comment': 'first' }, { 'modaliases': ['foo*'], 'comment': 'notfirst' }, ] aliases = ['foobar'] driver = match_aliases_to_driver(aliases, drivers) self.assertEqual(drivers[0], driver)
def test_finds_no_match(self): drivers = [{"modaliases": ["foo*"]}] aliases = ["bar"] driver = match_aliases_to_driver(aliases, drivers) self.assertIsNone(driver)
def test_finds_no_match(self): drivers = [{'modaliases': ['foo*']}] aliases = ['bar'] driver = match_aliases_to_driver(aliases, drivers) self.assertIsNone(driver)