[Python-modules-commits] [python-phpserialize] 04/07: Use an OrderedDict to make the dict serialization test reliable.
Tristan Seligmann
mithrandi at moszumanska.debian.org
Wed Oct 14 18:06:35 UTC 2015
This is an automated email from the git hooks/post-receive script.
mithrandi pushed a commit to branch master
in repository python-phpserialize.
commit e41b544fdd95d0ea82bfea0b8d0abdde533909c1
Author: Tristan Seligmann <mithrandi at mithrandi.net>
Date: Wed Oct 14 20:04:01 2015 +0200
Use an OrderedDict to make the dict serialization test reliable.
---
tests.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests.py b/tests.py
index f6d7066..ca407d4 100644
--- a/tests.py
+++ b/tests.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import unittest
import phpserialize
+from collections import OrderedDict
class PhpSerializeTestCase(unittest.TestCase):
@@ -32,7 +33,7 @@ class PhpSerializeTestCase(unittest.TestCase):
b'a:3:{i:0;i:7;i:1;i:8;i:2;i:9;}')
def test_dumps_dict(self):
- self.assertEqual(phpserialize.dumps({'a': 1, 'b': 2, 'c': 3}),
+ self.assertEqual(phpserialize.dumps(OrderedDict([('a', 1), ('c', 3), ('b': 2)])),
b'a:3:{s:1:"a";i:1;s:1:"c";i:3;s:1:"b";i:2;}')
def test_loads_dict(self):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-phpserialize.git
More information about the Python-modules-commits
mailing list