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)
示例#2
0
    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)
示例#4
0
 def test_finds_no_match(self):
     drivers = [{'modaliases': ['foo*']}]
     aliases = ['bar']
     driver = match_aliases_to_driver(aliases, drivers)
     self.assertIsNone(driver)