[tracker: 3/3] Merge branch 'sam/test-utils' into 'master'



commit b6ccb5249830b242ec10e1e691a30d6d85921eb1
Merge: d8665507b 367300214
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Apr 4 11:19:57 2020 +0000

    Merge branch 'sam/test-utils' into 'master'
    
    Functional test improvements
    
    See merge request GNOME/tracker!207

 tests/functional-tests/cli.py              |  2 +-
 tests/functional-tests/coalesce.py         |  2 +-
 tests/functional-tests/collation.py        |  2 +-
 tests/functional-tests/concurrent-query.py |  2 +-
 tests/functional-tests/configuration.py    | 16 ++--------------
 tests/functional-tests/distance.py         |  2 +-
 tests/functional-tests/fixtures.py         | 22 ++++++++++++++++++++++
 tests/functional-tests/fts-functions.py    |  2 +-
 tests/functional-tests/graph.py            |  2 +-
 tests/functional-tests/group-concat.py     |  2 +-
 tests/functional-tests/insertion.py        |  2 +-
 tests/functional-tests/notifier.py         |  2 +-
 tests/functional-tests/ontology-changes.py |  3 ++-
 tests/functional-tests/query.py            |  2 +-
 tests/functional-tests/sparql-bugs.py      |  2 +-
 utils/trackertestutils/dbusdaemon.py       | 15 +++++++++++----
 utils/trackertestutils/helpers.py          |  6 ++++++
 17 files changed, 55 insertions(+), 31 deletions(-)
---
diff --cc tests/functional-tests/insertion.py
index 4db193d6a,fc1f3671e..56390dc48
--- a/tests/functional-tests/insertion.py
+++ b/tests/functional-tests/insertion.py
@@@ -717,5 -717,74 +717,5 @@@ class TrackerStoreDeleteTests (fixtures
          self.assertEqual(after_removal, initial)
  
  
 -class TrackerStorePhoneNumberTest (fixtures.TrackerSparqlDirectTest):
 -    """
 -    Tests around phone numbers (maemo specific). Inserting correct/incorrect ones
 -    and running query to get the contact from the number.
 -    """
 -
 -    def test_phone_01(self):
 -        """
 -        1. Setting the maemo:localPhoneNumber property to last 7 digits of phone number.
 -        2. Receiving a message  from a contact whose localPhoneNumber is saved.
 -        3. Query messages from the local phone number
 -        """
 -
 -        INSERT_CONTACT_PHONE = """
 -                INSERT {
 -                    <tel:123456789> a nco:PhoneNumber ;
 -                          nco:phoneNumber  '00358555444333' ;
 -                          maemo:localPhoneNumber '5444333'.
 -
 -                    <test://test_phone_1/contact> a nco:PersonContact;
 -                        nco:contactUID '112';
 -                        nco:nameFamily 'Family-name'  ;
 -                        nco:nameGiven 'Given-name'.
 -                    <test://test_phone_1/contact> nco:hasPhoneNumber <tel:123456789>.
 -                }
 -                """
 -        self.tracker.update(INSERT_CONTACT_PHONE)
 -
 -        INSERT_MESSAGE = """
 -                INSERT {
 -                    <test://test_phone_1/message> a nmo:Message ;
 -                         nmo:from [a nco:Contact ; nco:hasPhoneNumber <tel:123456789>];
 -                         nmo:receivedDate '2010-01-02T10:13:00Z' ;
 -                         nie:plainTextContent 'hello'
 -                }
 -                """
 -        self.tracker.update(INSERT_MESSAGE)
 -
 -        QUERY_SPARQL = """
 -                SELECT ?msg WHERE {
 -                     ?msg a nmo:Message;
 -                         nmo:from ?c .
 -                     ?c nco:hasPhoneNumber ?n .
 -                     ?n maemo:localPhoneNumber '5444333'.
 -                } """
 -        result = self.tracker.query(QUERY_SPARQL)
 -        self.assertEqual(len(result), 1)
 -        self.assertEqual(len(result[0]), 1)
 -        self.assertEqual(result[0][0], "test://test_phone_1/message")
 -
 -    def test_phone_02(self):
 -        """
 -        Inserting a local phone number which have spaces
 -        """
 -        INSERT_SPARQL = """
 -                INSERT {
 -                        <tel+3333333333> a nco:PhoneNumber ;
 -                                nco:phoneNumber  <tel+3333333333> ;
 -                                maemo:localPhoneNumber '333 333'.
 -
 -                        <test://test_phone_02/contact> a nco:PersonContact;
 -                                nco:nameFamily 'test_name_01' ;
 -                                nco:nameGiven 'test_name_02';
 -                                nco:hasPhoneNumber <tel+3333333333> .
 -                }
 -                """
 -        self.tracker.update(INSERT_SPARQL)
 -
 -
  if __name__ == "__main__":
-     ut.main(verbosity=2)
+     fixtures.tracker_test_main()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]