~mthaddon/mojo/string-concat

« back to all changes in this revision

Viewing changes to mojo/tests/test_phase.py

  • Committer: mergebot at canonical
  • Author(s): "Barry Price"
  • Date: 2020-07-29 10:02:47 UTC
  • mfrom: (563.3.3 mojo-lp1884039)
  • Revision ID: mergebot@juju-139df4-prod-is-toolbox-0.canonical.com-20200729100247-w6tzibzg2qy3o7zp
Ensure that we only compare strings when checking for spurious whitespace

Reviewed-on: https://code.launchpad.net/~barryprice/mojo/trunk/+merge/387583
Reviewed-by: Tom Haddon <tom.haddon@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from deployer.utils import ErrorExit
12
12
from mojo.phase import (
13
13
    process_config_changes_from_diff,
 
14
    identical_but_wrapped_in_newlines,
14
15
    BundlePhase,
15
16
    CharmAuditPhase,
16
17
    CharmRepoPhase,
171
172
        )
172
173
        self.assertEqual(expected_command, command)
173
174
 
 
175
    def test_identical_but_wrapped_in_newlines(self):
 
176
        self.assertEqual(identical_but_wrapped_in_newlines("foo", "foo"), True)
 
177
        self.assertEqual(identical_but_wrapped_in_newlines("foo", "\nfoo\n"), True)
 
178
        self.assertEqual(identical_but_wrapped_in_newlines(b"foo", b"\nfoo\n"), True)
 
179
        self.assertEqual(identical_but_wrapped_in_newlines(True, True), True)
 
180
 
174
181
    @mock.patch("subprocess.check_call")
175
182
    @mock.patch("logging.info")
176
183
    def test_process_config_changes_from_diff(self, _logging_info, _check_call):