[PATCH] Add a test for convertTo's precision.
Anne Mulhern
amulhern at redhat.com
Fri Sep 26 17:30:31 UTC 2014
----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, September 26, 2014 1:28:31 PM
> Subject: [PATCH] Add a test for convertTo's precision.
>
> ---
> tests/size_test.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tests/size_test.py b/tests/size_test.py
> index e2288e0..95f2c1d 100644
> --- a/tests/size_test.py
> +++ b/tests/size_test.py
> @@ -104,6 +104,12 @@ class SizeTestCase(unittest.TestCase):
> s = Size("12.6998 TiB")
> self.assertEquals(s.humanReadable(max_places=2), "12.7 TiB")
>
> + def testConvertToPrecision(self):
> + s = Size(1835008)
> + self.assertEquals(s.convertTo(spec="b"), 1835008)
> + self.assertEquals(s.convertTo(spec="KiB", 1792)
> + self.assertEquals(s.convertTo(spec="MiB", 1.75))
> +
> def testNegative(self):
> s = Size("-500MiB")
> self.assertEquals(s.humanReadable(), "-500 MiB")
> --
> 1.9.3
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
Thanks for the test. This hadn't landed yet, when I was reviewing the change.
- mulhern
More information about the anaconda-patches
mailing list