def test_a_auth(self):
     """
     Test that the auth state machine works with this device
     
     We are tricky and we append the _a_ so it will be executed first
     """
     if not conf:
         raise SkipTest("Not config")
     
     def post_configure_device(ignored):
         d = self.device.initialize()
         d.addCallback(lambda _: self.sconn.delete_all_sms())
         d.addCallback(lambda _: self.sconn.delete_all_contacts())
         return d
     
     def check_pin_status(ignored):
         d = self.sconn.check_pin()
         #d.addCallback(lambda status: self.assertEqual(status, 'READY'))
         d.addCallback(post_configure_device)
         return d
     
     config = {'pin' : conf.get('test', 'pin')}
     authsm = AuthStateMachine(self.device, CLICollaboratorFactory, config)
     d = authsm.start_auth()
     d.addCallback(check_pin_status)
     return d
    def test_a_auth(self):
        """
        Test that the auth state machine works with this device
        
        We are tricky and we append the _a_ so it will be executed first
        """
        if not conf:
            raise SkipTest("Not config")

        def post_configure_device(ignored):
            d = self.device.postinit()
            d.addCallback(lambda _: self.sconn.delete_all_sms())
            d.addCallback(lambda _: self.sconn.delete_all_contacts())
            return d

        def check_pin_status(ignored):
            d = self.sconn.check_pin()
            #d.addCallback(lambda status: self.assertEqual(status, 'READY'))
            d.addCallback(post_configure_device)
            return d

        config = {'pin': conf.get('test', 'pin')}
        authsm = AuthStateMachine(self.device, CLICollaboratorFactory, config)
        d = authsm.start_auth()
        d.addCallback(check_pin_status)
        return d
Esempio n. 3
0
    def _authenticate(self, ignored=None):
        if not conf:
            raise SkipTest("Not config")

        def post_configure_device(ignored):
            d = self.device.postinit()
            d.addCallback(lambda _: self.sconn.delete_all_sms())
            d.addCallback(lambda _: self.sconn.delete_all_contacts())
            self.phonebook = get_phonebook(self.sconn)
            return d

        def check_pin_status(ignored):
            d = self.sconn.check_pin()
            #d.addCallback(lambda status: self.assertEqual(status, 'READY'))
            d.addCallback(post_configure_device)
            return d

        config = {'pin': conf.get('test', 'pin')}
        authsm = AuthStateMachine(self.device, CLICollaboratorFactory, config)
        d = authsm.start_auth()
        d.addCallback(check_pin_status)
        return d
    def _authenticate(self, ignored=None):
        if not conf:
            raise SkipTest("Not config")

        def post_configure_device(ignored):
            d = self.device.postinit()
            d.addCallback(lambda _: self.sconn.delete_all_sms())
            d.addCallback(lambda _: self.sconn.delete_all_contacts())
            self.messages = get_messages_obj(self.sconn)
            return d

        def check_pin_status(ignored):
            d = self.sconn.check_pin()
            # d.addCallback(lambda status: self.assertEqual(status, 'READY'))
            d.addCallback(post_configure_device)
            return d

        config = {"pin": conf.get("test", "pin")}
        authsm = AuthStateMachine(self.device, CLICollaboratorFactory, config)
        d = authsm.start_auth()
        d.addCallback(check_pin_status)
        return d