summaryrefslogtreecommitdiff
path: root/tests/functional-tests/601-applications-sync.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional-tests/601-applications-sync.py')
-rwxr-xr-xtests/functional-tests/601-applications-sync.py39
1 files changed, 21 insertions, 18 deletions
diff --git a/tests/functional-tests/601-applications-sync.py b/tests/functional-tests/601-applications-sync.py
index c3747c62d..b2b056120 100755
--- a/tests/functional-tests/601-applications-sync.py
+++ b/tests/functional-tests/601-applications-sync.py
@@ -22,7 +22,9 @@
Tests trying to simulate the behaviour of applications working with tracker
"""
-import sys,os,dbus
+import sys
+import os
+import dbus
import unittest
import time
import random
@@ -39,7 +41,7 @@ from common.utils.helpers import log
class TrackerSyncApplicationTests (CommonTrackerApplicationTest):
- def test_01_sync_audio_nb219946 (self):
+ def test_01_sync_audio_nb219946(self):
"""
Sync simulation (after fix for NB#219946):
@@ -62,11 +64,13 @@ class TrackerSyncApplicationTests (CommonTrackerApplicationTest):
This is because the test already inserted the resource in the store.
"""
- origin_filepath = os.path.join (self.get_data_dir (), self.get_test_music ())
- dest_filepath = os.path.join (self.get_dest_dir (), self.get_test_music ())
+ origin_filepath = os.path.join(
+ self.get_data_dir(), self.get_test_music())
+ dest_filepath = os.path.join(
+ self.get_dest_dir(), self.get_test_music())
dest_fileuri = "file://" + dest_filepath
- log ("Synchronizing audio file in '%s'..." % (dest_filepath))
+ log("Synchronizing audio file in '%s'..." % (dest_filepath))
# Insert new resource in the store
insert = """
@@ -98,25 +102,24 @@ class TrackerSyncApplicationTests (CommonTrackerApplicationTest):
nmm:artistName 'AbBaby'
}
""" % (dest_fileuri, dest_fileuri)
- self.tracker.update (insert)
- self.assertEquals (self.get_urn_count_by_url (dest_fileuri), 1)
+ self.tracker.update(insert)
+ self.assertEquals(self.get_urn_count_by_url(dest_fileuri), 1)
resource_id = self.tracker.get_resource_id(dest_fileuri)
# Copy the image to the dest path
- self.slowcopy_file (origin_filepath, dest_filepath)
- assert os.path.exists (dest_filepath)
- self.tracker.await_resource_inserted ('nmm:MusicPiece', url=dest_fileuri)
+ self.slowcopy_file(origin_filepath, dest_filepath)
+ assert os.path.exists(dest_filepath)
+ self.tracker.await_resource_inserted(
+ 'nmm:MusicPiece', url=dest_fileuri)
- self.assertEquals (self.get_urn_count_by_url (dest_fileuri), 1)
+ self.assertEquals(self.get_urn_count_by_url(dest_fileuri), 1)
# Clean the new file so the test directory is as before
- log ("Remove and wait")
- os.remove (dest_filepath)
- self.tracker.await_resource_deleted (resource_id)
- self.assertEquals (self.get_urn_count_by_url (dest_fileuri), 0)
+ log("Remove and wait")
+ os.remove(dest_filepath)
+ self.tracker.await_resource_deleted(resource_id)
+ self.assertEquals(self.get_urn_count_by_url(dest_fileuri), 0)
if __name__ == "__main__":
- ut.main()
-
-
+ ut.main()