disabling another flaky test

This commit is contained in:
Steven Robertson 2020-02-21 15:43:18 -08:00
parent 2ceb44c337
commit fb7de03555
1 changed files with 37 additions and 36 deletions

View File

@ -64,45 +64,46 @@ class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
del os.environ['PREHISTORIC_SUDO'] del os.environ['PREHISTORIC_SUDO']
class NonEnglishPromptTest(testlib.DockerMixin, testlib.TestCase): # TODO: https://github.com/dw/mitogen/issues/694
# Only mitogen/debian-test has a properly configured sudo. # class NonEnglishPromptTest(testlib.DockerMixin, testlib.TestCase):
mitogen_test_distro = 'debian' # # Only mitogen/debian-test has a properly configured sudo.
# mitogen_test_distro = 'debian'
def test_password_required(self): # def test_password_required(self):
ssh = self.docker_ssh( # ssh = self.docker_ssh(
username='mitogen__has_sudo', # username='mitogen__has_sudo',
password='has_sudo_password', # password='has_sudo_password',
) # )
ssh.call(os.putenv, 'LANGUAGE', 'fr') # ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8') # ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError, # e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh) # lambda: self.router.sudo(via=ssh)
) # )
self.assertTrue(mitogen.sudo.password_required_msg in str(e)) # self.assertTrue(mitogen.sudo.password_required_msg in str(e))
def test_password_incorrect(self): # def test_password_incorrect(self):
ssh = self.docker_ssh( # ssh = self.docker_ssh(
username='mitogen__has_sudo', # username='mitogen__has_sudo',
password='has_sudo_password', # password='has_sudo_password',
) # )
ssh.call(os.putenv, 'LANGUAGE', 'fr') # ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8') # ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError, # e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh, password='x') # lambda: self.router.sudo(via=ssh, password='x')
) # )
self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e)) # self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
def test_password_okay(self): # def test_password_okay(self):
ssh = self.docker_ssh( # ssh = self.docker_ssh(
username='mitogen__has_sudo', # username='mitogen__has_sudo',
password='has_sudo_password', # password='has_sudo_password',
) # )
ssh.call(os.putenv, 'LANGUAGE', 'fr') # ssh.call(os.putenv, 'LANGUAGE', 'fr')
ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8') # ssh.call(os.putenv, 'LC_ALL', 'fr_FR.UTF-8')
e = self.assertRaises(mitogen.core.StreamError, # e = self.assertRaises(mitogen.core.StreamError,
lambda: self.router.sudo(via=ssh, password='rootpassword') # lambda: self.router.sudo(via=ssh, password='rootpassword')
) # )
self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e)) # self.assertTrue(mitogen.sudo.password_incorrect_msg in str(e))
if __name__ == '__main__': if __name__ == '__main__':