コード例 #1
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        #
        # Import contacts (adjust to the correct numbers.
        #
        self.Contact_1 = MockContacts().Contact_1
        self.Contact_2 = MockContacts().Contact_2

        self.Contact_1["tel"]["value"] = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM")
        self.Contact_2["tel"]["value"] = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM_SHORT")

        self.UTILS.logComment("Using target telephone number " +
                              self.Contact_1["tel"]["value"])
        self.UTILS.logComment("Using target telephone number " +
                              self.Contact_2["tel"]["value"])

        self.data_layer.insert_contact(self.Contact_1)
        self.data_layer.insert_contact(self.Contact_2)
コード例 #2
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.messages   = Messages(self)
        self.contacts   = Contacts(self)
        
        #
        # Import some contacts.
        #
        self.Contact_1 = MockContacts().Contact_1
        self.Contact_2 = MockContacts().Contact_2
        self.Contact_3 = MockContacts().Contact_longName
        self.Contact_4 = MockContacts().Contact_multiplePhones
        self.Contact_5 = MockContacts().Contact_multipleEmails

        # Set the one we'll match to have a valid phone number.
        self.Contact_1["tel"]["value"] = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.UTILS.logComment("Using target telephone number " + self.Contact_1["tel"]["value"])
        
        # Set a couple of them to be favorites (including the one we'll use).
        self.Contact_1["category"] = "favorite"
        self.Contact_2["category"] = "favorite"
        
        # Insert all the contacts.
        self.data_layer.insert_contact(self.Contact_1)
        self.data_layer.insert_contact(self.Contact_2)
        self.data_layer.insert_contact(self.Contact_3)
        self.data_layer.insert_contact(self.Contact_4)
        self.data_layer.insert_contact(self.Contact_5)
コード例 #3
0
 def setUp(self):
     #
     # Set up child objects...
     #
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.contacts   = Contacts(self)
     
     #
     # Get details of our test contacts.
     #
     self.Contact_1 = MockContacts().Contact_1
     self.Contact_2 = MockContacts().Contact_2
     self.data_layer.insert_contact(self.Contact_1)
     self.data_layer.insert_contact(self.Contact_2)
コード例 #4
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        #
        # Insert a contact without email addresses
        #
        self.UTILS.addFileToDevice('./tests/_resources/contact_face.jpg',
                                   destination='DCIM/100MZLLA')
        self.Contact_1 = MockContacts().Contact_1
        self.Contact_1["email"]["value"] = ""
        self.data_layer.insert_contact(self.Contact_1)

        #
        # Establish which phone number to use.
        #
        self.target_telNum = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM")
        self.UTILS.logComment("Sending sms to telephone number " +
                              self.target_telNum)
コード例 #5
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        #
        # Prepare the contact we're going to insert.
        #
        self.contact_1 = MockContacts().Contact_1

        #
        # Set given and family name to empty string
        #
        self.contact_1["givenName"] = ""
        self.contact_1["familyName"] = ""
        self.contact_1["name"] = ""
        self.contact_1["tel"]["value"] = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM")

        #
        # Import this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        #
        self.data_layer.insert_contact(self.contact_1)
コード例 #6
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.email = Email(self)

        #
        # Get details of our test contacts.
        #
        self.Contact_1 = MockContacts().Contact_multipleEmails

        #
        # Set the emails to ones that work.
        #
        self.Contact_1["email"][0]["value"] = self.UTILS.get_os_variable(
            "GMAIL_1_EMAIL")
        self.Contact_1["email"][1]["value"] = self.UTILS.get_os_variable(
            "GMAIL_2_EMAIL")
        self.Contact_1["email"][2]["value"] = self.UTILS.get_os_variable(
            "HOTMAIL_1_EMAIL")

        #
        # We're not testing adding a contact, so just stick one
        # into the database.
        #
        self.data_layer.insert_contact(self.Contact_1)

        self._email_subject = "TEST " + str(time.time())
        self._email_message = "Test message"
コード例 #7
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        #
        # Prepare the contact we're going to insert.
        #
        self.contact_1 = MockContacts().Contact_1

        #
        # Establish which phone number to use.
        #
        self.num = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.contact_1["tel"]["value"] = self.num
        self.UTILS.logComment("Using target telephone number " +
                              self.contact_1["tel"]["value"])

        #
        # Import this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
        #
        self.data_layer.insert_contact(self.contact_1)
コード例 #8
0
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)
        self.contacts = Contacts(self)

        self.num = "0044" + self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.cont = MockContacts().Contact_1
コード例 #9
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contacts.
        #
        self.cont1 = MockContacts().Contact_1
        self.cont2 = MockContacts().Contact_2

        self.cont1["givenName"] = self.cont1["tel"]["value"]
        self.cont2["familyName"] = self.cont2["tel"]["value"]

        self.data_layer.insert_contact(self.cont1)
        self.data_layer.insert_contact(self.cont2)
コード例 #10
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contacts.
        #
        self.Contact_1 = MockContacts().Contact_1
        self.Contact_2 = MockContacts().Contact_2

        #
        # We're not testing adding a contact, so just stick one
        # into the database.
        #
        self.data_layer.insert_contact(self.Contact_1)
コード例 #11
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)

        self.gmail_u = self.UTILS.get_os_variable("GMAIL_1_USER")
        self.gmail_p = self.UTILS.get_os_variable("GMAIL_1_PASS")

        #
        # Get details of our test contacts.
        #
        self.cont = MockContacts().Contact_1
        self.cont2 = MockContacts().Contact_2

        self.data_layer.insert_contact(self.cont)

        self.cont2["email"] = ""
コード例 #12
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.messages   = Messages(self)
        
        #
        # Establish which phone number to use and set up the contacts.
        #
        self.contact_1 = MockContacts().Contact_1
        self.contact_2 = MockContacts().Contact_2
        
        self.num1 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.num2 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM_SHORT")
        
        self.contact_1["tel"]["value"] = self.num1
        self.contact_2["tel"]["value"] = self.num2

        self.data_layer.insert_contact(self.contact_1)
        self.data_layer.insert_contact(self.contact_2)
コード例 #13
0
 def setUp(self):
     # Set up child objects...
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.dialer     = Dialer(self)
     self.contacts   = Contacts(self)
     
     self.num  = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
     self.num2 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM_SHORT")
     
     self.cont = MockContacts().Contact_1
     self.cont["tel"]["value"] = self.num2
     self.data_layer.insert_contact(self.cont)
コード例 #14
0
 def setUp(self):
     #
     # Set up child objects...
     #
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.messages   = Messages(self)
     
     
     #
     # Prepare the contact we're going to insert.
     #
     self.contact_1 = MockContacts().Contact_1
     self.contact_2 = MockContacts().Contact_2
     self.contact_3 = MockContacts().Contact_longName
     
     #
     # Add this contact (quick'n'dirty method - we're just testing sms, no adding a contact).
     #
     self.data_layer.insert_contact(self.contact_1)
     self.data_layer.insert_contact(self.contact_2)
     self.data_layer.insert_contact(self.contact_3)
コード例 #15
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contacts.
        #
        self.cont1 = MockContacts().Contact_1
        self.cont2 = MockContacts().Contact_2
        self.cont3 = MockContacts().Contact_3

        self.cont1["tel"]["value"] = "111111111"
        self.cont2["tel"]["value"] = "222222222"
        self.cont3["tel"]["value"] = "333333333"

        self.data_layer.insert_contact(self.cont1)
        self.data_layer.insert_contact(self.cont2)
        self.data_layer.insert_contact(self.cont3)
コード例 #16
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        self.num1 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")

        self.cont = MockContacts().Contact_1
        self.data_layer.insert_contact(self.cont)
コード例 #17
0
    def setUp(self):

        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contacts.
        #
        self.cont1 = MockContacts().Contact_1
        self.cont2 = MockContacts().Contact_2

        #
        # Make sure we can find both of them with a search.
        #
        self.cont1["tel"]["value"] = "123111111"
        self.cont2["tel"]["value"] = "123222222"

        self.data_layer.insert_contact(self.cont2)
コード例 #18
0
    def setUp(self):

        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contact.
        #
        self.Contact_1 = MockContacts().Contact_1
コード例 #19
0
 def setUp(self):
     # Set up child objects...
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.dialer     = Dialer(self)
     self.contacts   = Contacts(self)
     
     self.num        = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
     self.num_short  = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM_SHORT")
     
     # Remove the phone number from the contact and insert it.
     self.cont = MockContacts().Contact_1
     self.cont["tel"]["value"]   = self.num
     self.data_layer.insert_contact(self.cont)
コード例 #20
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        #
        # Import contact (adjust to the correct number).
        #
        self.Contact_twoPhones = MockContacts().Contact_twoPhones
        self.data_layer.insert_contact(self.Contact_twoPhones)
コード例 #21
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.contacts   = Contacts(self)
        self.settings   = Settings(self)

        #
        # Get details of our test contacts.
        #
        self.cont = MockContacts().Contact_twoPhones
        self.data_layer.insert_contact(self.cont)
コード例 #22
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        #
        # Remove number and import contact.
        #
        self.Contact_1 = MockContacts().Contact_1
        self.Contact_1["tel"] = None
        self.data_layer.insert_contact(self.Contact_1)
コード例 #23
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        #
        # Get details of our test contacts.
        #
        self.Contact_1 = MockContacts().Contact_1
        self.data_layer.insert_contact(self.Contact_1)
        self.UTILS.addFileToDevice('./tests/_resources/contact_face.jpg',
                                   destination='DCIM/100MZLLA')
コード例 #24
0
 def setUp(self):
     #
     # Set up child objects...
     #
     GaiaTestCase.setUp(self)
     self.UTILS      = UTILS(self)
     self.messages   = Messages(self)
     self.contacts   = Contacts(self)
     
     self.num1 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
     self.emailAddy = self.UTILS.get_os_variable("GMAIL_1_EMAIL")
     
     self.UTILS.addFileToDevice('./tests/_resources/contact_face.jpg', destination='DCIM/100MZLLA')
     
     self.cont = MockContacts().Contact_multipleEmails
     self.data_layer.insert_contact(self.cont)
コード例 #25
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS      = UTILS(self)
        self.messages   = Messages(self)
        self.Email      = Email(self)

        self.USER1  = self.UTILS.get_os_variable("GMAIL_1_USER")
        self.EMAIL1 = self.UTILS.get_os_variable("GMAIL_1_EMAIL")
        self.PASS1  = self.UTILS.get_os_variable("GMAIL_1_PASS")
         
        self.num1 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.emailAddy = self.UTILS.get_os_variable("GMAIL_2_EMAIL")

        self.cont = MockContacts().Contact_1
        self.cont["email"]["value"] = self.emailAddy
        self.data_layer.insert_contact(self.cont)        
コード例 #26
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)

        #
        # Put the phone into airplane mode.
        #
        self.data_layer.set_setting('ril.radio.disabled', False)

        self.Contact_1 = MockContacts().Contact_1
        self.Contact_1["tel"]["value"] = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM")

        self.data_layer.insert_contact(self.Contact_1)
コード例 #27
0
    def setUp(self):
        #
        # Set up child objects...
        #
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.contacts = Contacts(self)
        self.email = Email(self)

        self.num1 = self.UTILS.get_os_variable("GLOBAL_TARGET_SMS_NUM")
        self.emailAddy = self.UTILS.get_os_variable("GMAIL_1_EMAIL")
        self.emailE = self.UTILS.get_os_variable("GMAIL_2_EMAIL")
        self.emailP = self.UTILS.get_os_variable("GMAIL_2_PASS")
        self.emailU = self.UTILS.get_os_variable("GMAIL_2_USER")

        self.UTILS.addFileToDevice('./tests/_resources/contact_face.jpg',
                                   destination='DCIM/100MZLLA')

        self.cont = MockContacts().Contact_1
コード例 #28
0
    def test_run(self):
        #
        # Launch messages app.
        #
        self.messages.launch()

        #
        # Send a message to create a thread (use number, not name as this
        # avoids some blocking bugs just now).
        #
        self.messages.createAndSendSMS([self.Contact_1["tel"]["value"]],
                                       "Test message.")
        self.messages.waitForReceivedMsgInThisThread()

        #
        # Open contacts app and modify the contact used to send the SMS in the previous step
        #
        self.contacts.launch()
        self.Contact_2 = MockContacts().Contact_2
        self.Contact_2["tel"]["value"] = self.UTILS.get_os_variable(
            "GLOBAL_TARGET_SMS_NUM")
        self.UTILS.logComment("Using target telephone number " +
                              self.Contact_2["tel"]["value"])
        self.contacts.editContact(self.Contact_1, self.Contact_2)

        #
        # Re-launch messages app.
        #
        self.messages.launch()

        #
        # Verify the thread now contains the name of the contact instead of the phone number
        #
        self.UTILS.logComment("Trying to open the thread with name: " +
                              self.Contact_2["name"])
        self.messages.openThread(self.Contact_2["name"])