[pygobject] Split test_everything.TestEverything.test_string() into multiple tests
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] Split test_everything.TestEverything.test_string() into multiple tests
- Date: Fri, 12 Sep 2014 02:33:28 +0000 (UTC)
commit a2f98a9ba0b0dda0d3cf59651327e5c93d5479d6
Author: Simon Feltman <sfeltman src gnome org>
Date: Thu Sep 11 19:32:53 2014 -0700
Split test_everything.TestEverything.test_string() into multiple tests
https://bugzilla.gnome.org/show_bug.cgi?id=735193
tests/test_everything.py | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/tests/test_everything.py b/tests/test_everything.py
index c9c5ce7..741de1a 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -33,6 +33,12 @@ else:
UNICHAR = "♥"
+const_str = b'const \xe2\x99\xa5 utf8'
+if sys.version_info >= (3, 0):
+ const_str = const_str.decode('UTF-8')
+noconst_str = 'non' + const_str
+
+
class RawGList(ctypes.Structure):
_fields_ = [('data', ctypes.c_void_p),
('next', ctypes.c_void_p),
@@ -221,27 +227,34 @@ class TestEverything(unittest.TestCase):
timeout = v.lookup_value('timeout', None)
self.assertEqual(timeout.get_int32(), 10)
- def test_string(self):
- const_str = b'const \xe2\x99\xa5 utf8'
- if sys.version_info >= (3, 0):
- const_str = const_str.decode('UTF-8')
- noconst_str = 'non' + const_str
-
+ def test_utf8_const_return(self):
self.assertEqual(Everything.test_utf8_const_return(), const_str)
+
+ def test_utf8_nonconst_return(self):
self.assertEqual(Everything.test_utf8_nonconst_return(), noconst_str)
+
+ def test_utf8_out(self):
self.assertEqual(Everything.test_utf8_out(), noconst_str)
+ def test_utf8_const_in(self):
Everything.test_utf8_const_in(const_str)
+
+ def test_utf8_inout(self):
self.assertEqual(Everything.test_utf8_inout(const_str), noconst_str)
+ def test_filename_return(self):
self.assertEqual(Everything.test_filename_return(), ['åäö', '/etc/fstab'])
+ def test_int_out_utf8(self):
# returns g_utf8_strlen() in out argument
self.assertEqual(Everything.test_int_out_utf8(''), 0)
self.assertEqual(Everything.test_int_out_utf8('hello world'), 11)
self.assertEqual(Everything.test_int_out_utf8('åäö'), 3)
+ def test_utf8_out_out(self):
self.assertEqual(Everything.test_utf8_out_out(), ('first', 'second'))
+
+ def test_utf8_out_nonconst_return(self):
self.assertEqual(Everything.test_utf8_out_nonconst_return(), ('first', 'second'))
def test_enum(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]