[gexiv2] Update testsuite to match current test runner
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gexiv2] Update testsuite to match current test runner
- Date: Tue, 25 Apr 2017 16:48:15 +0000 (UTC)
commit 10adb714dbfb4d19e58386e2a5a398aade07005b
Author: Jens Georg <mail jensge org>
Date: Tue Apr 25 18:40:34 2017 +0200
Update testsuite to match current test runner
https://bugzilla.gnome.org/show_bug.cgi?id=712455
check.am | 7 ++++---
test/{ => data}/CaorVN.jpeg | Bin 293768 -> 293768 bytes
test/data/original.jpg | Bin 0 -> 56080 bytes
test/{ => data}/sample-author-badencoding.jpg | Bin 614 -> 614 bytes
test/python/gexiv2.py | 2 +-
{tests => test/python}/test_metadata.py | 11 ++++++-----
test/python2-test.in | 1 +
test/python3-test.in | 1 +
tests/__init__.py | 1 -
9 files changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/check.am b/check.am
index 59a8201..59196e4 100644
--- a/check.am
+++ b/check.am
@@ -34,9 +34,10 @@ LDADD = \
$(GLIB_LIBS) $(EXIV2_LIBS)
AM_CFLAGS = \
$(GLIB_CFLAGS) $(EXIV2_CFLAGS) \
- -I $(top_srcdir) -DSAMPLE_PATH="\"$(abs_top_srcdir)/test\""
+ -I $(top_srcdir) -DSAMPLE_PATH="\"$(abs_top_srcdir)/test/data\""
EXTRA_DIST += \
- test/sample-author-badencoding.jpg \
- test/CaorVN.jpeg
+ test/data/sample-author-badencoding.jpg \
+ test/data/CaorVN.jpeg \
+ test/data/original.jpg
diff --git a/test/data/original.jpg b/test/data/original.jpg
new file mode 100644
index 0000000..48056ca
Binary files /dev/null and b/test/data/original.jpg differ
diff --git a/test/python/gexiv2.py b/test/python/gexiv2.py
index 6f1ef5a..2b25eba 100644
--- a/test/python/gexiv2.py
+++ b/test/python/gexiv2.py
@@ -36,7 +36,7 @@ gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2
-SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..')
+SAMPLES_DIR = os.path.join(os.path.dirname(__file__), '..', 'data')
class TestGexiv2(unittest.TestCase):
diff --git a/tests/test_metadata.py b/test/python/test_metadata.py
similarity index 99%
rename from tests/test_metadata.py
rename to test/python/test_metadata.py
index 6e35857..d47e695 100644
--- a/tests/test_metadata.py
+++ b/test/python/test_metadata.py
@@ -29,6 +29,8 @@ import unittest
PY3K = sys.version_info[0] == 3
+import gi
+gi.require_version('GExiv2', '0.10')
from gi.repository import GExiv2
from fractions import Fraction
@@ -437,7 +439,7 @@ class TestMetadata(unittest.TestCase):
self.assertEqual(
results, [
- (0, GExiv2.Orientation.MIN),
+ (0, GExiv2.Orientation.UNSPECIFIED),
(1, GExiv2.Orientation.NORMAL),
(2, GExiv2.Orientation.HFLIP),
(3, GExiv2.Orientation.ROT_180),
@@ -450,7 +452,7 @@ class TestMetadata(unittest.TestCase):
def test_set_orientation(self):
rotations = [
- GExiv2.Orientation.MIN,
+ GExiv2.Orientation.UNSPECIFIED,
GExiv2.Orientation.NORMAL,
GExiv2.Orientation.HFLIP,
GExiv2.Orientation.ROT_180,
@@ -529,11 +531,10 @@ class TestMetadata(unittest.TestCase):
self.assertEqual(exposure, (10, 150))
def test_get_fnumber(self):
- #FIXME: WTF? 400 is the ISO, not the F number.
- self.assertEqual(self.metadata.get_fnumber(), 400)
+ self.assertEqual(self.metadata.get_fnumber(), 4.7)
def test_get_focal_length(self):
- self.assertEqual(self.metadata.get_focal_length(), 13)
+ self.assertEqual(self.metadata.get_focal_length(), 13.8)
def test_get_iso_speed(self):
self.assertEqual(self.metadata.get_iso_speed(), 400)
diff --git a/test/python2-test.in b/test/python2-test.in
index c58fc4c..dc45cfd 100755
--- a/test/python2-test.in
+++ b/test/python2-test.in
@@ -1,3 +1,4 @@
#!/bin/bash
@PYTHON2_PATH@ -m unittest gexiv2
+@PYTHON2_PATH@ -m unittest test_metadata
diff --git a/test/python3-test.in b/test/python3-test.in
index 70e4bbc..eb2f28d 100755
--- a/test/python3-test.in
+++ b/test/python3-test.in
@@ -1,3 +1,4 @@
#!/bin/bash
@PYTHON3_PATH@ -m unittest gexiv2
+@PYTHON3_PATH@ -m unittest test_metadata
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]