コード例 #1
0
    def test_missing_auth_json_keys(self):
        auth = CommitterAuth('path/to/auth.json')
        auth.open_auth_json_file = lambda: CMStringIO('{ "trac_credentials": "path/to/trac/credentials" }')
        self.assertFalse(auth.authenticate('*****@*****.**', 'committerpassword'))
        self.assertEqual('auth.json file is missing "webkit_committers" key', auth.errmsg())

        auth.open_auth_json_file = lambda: CMStringIO('{ "webkit_committers": "path/to/webkit/committers" }')
        auth.open_webkit_committers_file = self.fake_committers_file
        self.assertFalse(auth.authenticate('*****@*****.**', 'committerpassword'))
        self.assertEqual('auth.json file is missing "trac_credentials" key', auth.errmsg())
コード例 #2
0
    def test_missing_auth_json_keys(self):
        auth = CommitterAuth('path/to/auth.json')
        auth.open_auth_json_file = lambda: CMStringIO(
            '{ "trac_credentials": "path/to/trac/credentials" }')
        self.assertFalse(
            auth.authenticate('*****@*****.**', 'committerpassword'))
        self.assertEqual('auth.json file is missing "webkit_committers" key',
                         auth.errmsg())

        auth.open_auth_json_file = lambda: CMStringIO(
            '{ "webkit_committers": "path/to/webkit/committers" }')
        auth.open_webkit_committers_file = self.fake_committers_file
        self.assertFalse(
            auth.authenticate('*****@*****.**', 'committerpassword'))
        self.assertEqual('auth.json file is missing "trac_credentials" key',
                         auth.errmsg())