[PATCH 3/5] tests: Add tests for new SimpleConfigFile features

Vratislav Podzimek vpodzime at redhat.com
Thu Aug 9 07:57:29 UTC 2012


On Wed, 2012-08-08 at 14:49 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> ---
>  tests/pyanaconda_test/simpleconfig_test.py |   48 +++++++++++++++++++++++----
>  1 files changed, 41 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/pyanaconda_test/simpleconfig_test.py b/tests/pyanaconda_test/simpleconfig_test.py
> index ab59f5d..265ed88 100644
> --- a/tests/pyanaconda_test/simpleconfig_test.py
> +++ b/tests/pyanaconda_test/simpleconfig_test.py
> @@ -7,14 +7,10 @@ import sys
>  class SimpleconfigTest(mock.TestCase):
>      def setUp(self):
>          self.setupModules(["_isys", "block", "ConfigParser"])
> -        self.fs = mock.DiskIO()
I understand you are not using mock.DiskIO because the
SimpleConfig.write method takes path, right? You know what would be the
masterpiece? Add open_func=open argument to the SimpleConfig.__init__
method. That would allow tests use mock.DiskIO by passing self.fs.open
to it (for more details please refer to msivak's tech talk about
testing).

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list