Skip to content

Commit

Permalink
tests: Fix regex escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
tbzatek committed Aug 7, 2023
1 parent f732316 commit 11dfecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tests/dbus-tests/test_30_iscsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_login_chap_auth(self):
options['node.session.auth.chap_algs'] = 'SHA3-256,SHA256,SHA1' # disallow MD5
options['username'] = self.initiator

msg = 'Login failed: initiator reported error \(24 - iSCSI login failed due to authorization failure\)'
msg = r'Login failed: initiator reported error \(24 - iSCSI login failed due to authorization failure\)'
# missing auth info
with six.assertRaisesRegex(self, dbus.exceptions.DBusException, msg):
manager.Login(iqn, tpg, host, port, iface, self.no_options,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/dbus-tests/test_80_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_custom_option(self, should_fail, dbus_option, should_be_present, config
else:
mnt_path = block_fs.Mount(dd, dbus_interface=self.iface_prefix + '.Filesystem')
self.assertTrue(os.path.ismount(mnt_path))
_ret, out = self.run_command('mount | grep %s | sed "s/.*(\(.*\))/\\1/"' % block_fs_dev)
_ret, out = self.run_command(r'mount | grep %s | sed "s/.*(\(.*\))/\\1/"' % block_fs_dev)
if dbus_option is not None:
if should_be_present:
self.assertIn(dbus_option, out)
Expand Down

0 comments on commit 11dfecf

Please sign in to comment.