[master 2/2] Test for Size pickling support
vojtechtrefny
installerbot-noreply at redhat.com
Thu Apr 9 07:54:53 UTC 2015
From: Vojtech Trefny <vtrefny at redhat.com>
Signed-off-by: Vojtech Trefny <vtrefny at redhat.com>
---
tests/size_test.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/size_test.py b/tests/size_test.py
index 885ae8e..5997dfe 100644
--- a/tests/size_test.py
+++ b/tests/size_test.py
@@ -25,6 +25,8 @@
import os
import unittest
+from six.moves import cPickle
+
from decimal import Decimal
from blivet.i18n import _
@@ -194,6 +196,10 @@ def testScientificNotation(self):
self.assertEqual(size.parseSpec("1E-4KB"), Decimal("0.1"))
self.assertEqual(Size("1E-10KB"), Size(0))
+ def testPickling(self):
+ s = Size("10 MiB")
+ self.assertEqual(s, cPickle.loads(cPickle.dumps(s)))
+
class TranslationTestCase(unittest.TestCase):
def __init__(self, methodName='runTest'):
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/58defcb3c64472e82bbd8275ea5da2fb296d4049
More information about the anaconda-patches
mailing list