Exemplo n.º 1
0
    def test_authenticate_credentials(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        self.assertEqual(
            plugin.authenticateCredentials(self.valid_credentials),
            ('john.doe', 'john.doe'))
Exemplo n.º 2
0
    def test_authenticate_credentials(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        self.assertEqual(
            plugin.authenticateCredentials(self.valid_credentials),
            ('john.doe', 'john.doe'))
Exemplo n.º 3
0
    def test_authenticate_credentials_from_bad_ip_fails(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['ip'] = '192.168.1.2'

        self.assertEqual(plugin.authenticateCredentials(creds), None)
Exemplo n.º 4
0
    def test_authenticate_credentials_validates_extractor(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['extractor'] = 'wrong-extractor'

        self.assertEqual(plugin.authenticateCredentials(creds), None)
Exemplo n.º 5
0
    def test_authenticate_credentials_from_right_ip_succeeds(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['ip'] = '127.0.0.2'

        self.assertEqual(plugin.authenticateCredentials(creds),
                         ('john.doe', 'john.doe'))
Exemplo n.º 6
0
    def test_authenticate_credentials_from_right_ip_succeeds(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['ip'] = '127.0.0.2'

        self.assertEqual(
            plugin.authenticateCredentials(creds),
            ('john.doe', 'john.doe'))
Exemplo n.º 7
0
    def test_authenticate_credentials_from_bad_ip_fails(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['ip'] = '192.168.1.2'

        self.assertEqual(
            plugin.authenticateCredentials(creds),
            None)
Exemplo n.º 8
0
    def test_authenticate_credentials_validates_extractor(self):
        self.replay()
        plugin = BridgePlugin('bridge')
        plugin.REQUEST = self.create_dummy()

        creds = copy(self.valid_credentials)
        creds['extractor'] = 'wrong-extractor'

        self.assertEqual(
            plugin.authenticateCredentials(creds),
            None)