def setUp(self):
     """
     Create a passwd-like file with a user.
     """
     self.filename = self.mktemp()
     with open(self.filename, "wb") as f:
         f.write(b":".join(self.usernamePassword))
     self.options = manhole_tap.Options()
Exemple #2
0
    def test_requiresPort(self):
        """
        L{manhole_tap.makeService} requires either 'telnetPort' or 'sshPort' to
        be given.
        """
        with self.assertRaises(usage.UsageError) as e:
            manhole_tap.Options().parseOptions([])

        self.assertEqual(e.exception.args[0], ("At least one of --telnetPort "
                         "and --sshPort must be specified"))