Commit af3f82c1 authored by Sam Thursfield's avatar Sam Thursfield

Remove obsolete tracker-writeback testcase

There are more complete testcases in the functional-tests directory.
parent f00104f8
......@@ -6,11 +6,6 @@ if have_tracker_extract
subdir('libtracker-extract')
endif
# The test case for writeback doesn't seem to work.
#if enable_writeback
# subdir('tracker-writeback')
#endif
subdir('services')
test_bus_conf_file = configure_file(
......
#!/usr/bin/env python3
#
# Copyright (C) 2009, Nokia <ivan.frade@nokia.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
#
import dbus
import unittest
import random
import os
import shutil
import re
import time
import subprocess
TRACKER = 'org.freedesktop.Tracker1'
TRACKER_OBJ = '/org/freedesktop/Tracker1/Resources'
RESOURCES_IFACE = "org.freedesktop.Tracker1.Resources"
class TestInsertion (unittest.TestCase):
def setUp (self):
bus = dbus.SessionBus ()
tracker = bus.get_object (TRACKER, TRACKER_OBJ)
self.resources = dbus.Interface (tracker,
dbus_interface=RESOURCES_IFACE);
def test_simple_insertion (self):
try:
os.mkdir (os.getcwd() + "/tmp")
except:
print("")
shutil.copy2 (os.getcwd() + "/data/test01.jpg",
os.getcwd() + "/tmp/test01.jpg")
uri = "file://" + os.getcwd() + "/tmp/test01.jpg"
insert = """INSERT { <%s> a nfo:Image, nmm:Photo, nfo:FileDataObject;
nie:isStoredAs <%s> ;
nie:url '%s' ;
nie:title 'test_title_1' ;
nco:creator [ a nco:Contact ;
nco:fullname 'test_fullname_1' ] ;
nie:description 'test_description_1' ;
nie:keyword 'test_keyword_1' ;
nie:keyword 'test_keyword_2' ;
nie:keyword 'test_keyword_3' ;
nie:contentCreated '2001-10-26T21:32:52' ;
nfo:orientation nfo:orientation-top-mirror ;
nmm:meteringMode nmm:metering-mode-average ;
nmm:whiteBalance nmm:white-balance-auto ;
nmm:flash nmm:flash-on ;
nmm:focalLength '1' ;
nmm:exposureTime '1' ;
nmm:isoSpeed '1' ;
nmm:fnumber '1' ;
nfo:equipment [ a nfo:Equipment ; nfo:model 'Some Test Model' ] ;
nco:contributor [ a nco:Contact ;
nco:fullname 'test_fullname_2' ] ;
nie:copyright 'test_copyright_1'
}""" % (uri, uri, uri)
self.resources.SparqlUpdate (insert)
time.sleep (3)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_title_1")
self.assertEqual (ret, 0)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_fullname_1")
self.assertEqual (ret, 0)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_description_1")
self.assertEqual (ret, 0)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_keyword_1")
self.assertEqual (ret, 0)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_keyword_2")
self.assertEqual (ret, 0)
ret = os.system ("exiftool " + os.getcwd() + "/tmp/test01.jpg | grep test_keyword_3")
self.assertEqual (ret, 0)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment