Issue 771 (#773)

* Fixed the issue - Byte array variant was not properly converted to Python/Ruby objects.

* Added tests + properly converting byte arrays to byte array variants in Python.
This commit is contained in:
Matthias Köfferlein
2021-04-19 22:28:27 +02:00
committed by GitHub
parent 6a77c3ae9a
commit e6ab8c2483
5 changed files with 36 additions and 2 deletions
+7
View File
@@ -1304,6 +1304,13 @@ class BasicTest(unittest.TestCase):
self.assertEqual( str(b.b22c()), "hallo" )
self.assertEqual( type(b.b22c()).__name__, "LayerInfo" )
# byte arrays through Variants
if sys.version_info >= (3, 0):
self.assertEqual( b.b22a( [ bytes('abc', 'utf-8') ] ), 1 )
self.assertEqual( str(b.b22c()), "b'abc'" )
self.assertEqual( str(b.b22d()), "b'abc'" )
self.assertEqual( str(b.var()), "b'abc'" )
def test_23(self):
b = pya.B()