~fginther/landscape-client/fix-missing-install-dirs

« back to all changes in this revision

Viewing changes to landscape/tests/test_deployment.py

  • Committer: 🤖 Landscape Builder
  • Author(s): Steffen Allner
  • Date: 2017-04-05 15:59:20 UTC
  • mfrom: (997.2.3 py3-cleanup)
  • Revision ID: _landscape_builder-20170405155920-ffx0c6wpxo26i9xd
Merge py3-cleanup [f=] [r=ericsnowcurrently,landscape-builder,nilo] [a=Gocept]
Cleanups related to landscape.compat (and lint).

This MP cleans up small residues from the port to Python 2/3 compatibility. It removes the unwanted coerce_unicode() helper method, which was replaced by individual solutions at the respective place of use. Furthermore unused imports have been removed and the usage (c)StringIO has been investigated, whether it could be replaced by a common io.{String,Bytes}IO() call in Python 2 and 3. This was often not the case, as this was also connected with the logging setup in the tests, which should not be addressed here.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
from optparse import OptionParser
2
2
from textwrap import dedent
 
3
import io
3
4
import mock
4
5
import os
5
6
import os.path
6
7
import sys
7
8
 
8
 
from landscape.compat import StringIO
9
9
from landscape.lib.fs import read_text_file, create_text_file
10
10
 
11
11
from landscape.deployment import (
98
98
        L{get_config_filename}.
99
99
        """
100
100
        config_obj = self.config._get_config_object(
101
 
            alternative_config=StringIO("[client]\nlog_level = error\n"))
 
101
            alternative_config=io.StringIO(u"[client]\nlog_level = error\n"))
102
102
        self.assertEqual(None, config_obj.filename)
103
103
 
104
104
    def write_config_file(self, **kwargs):