Exemplo n.º 1
0
    def start_nuclide_server_and_get_outut(self, args):
        parser = nuclide_server_manager.get_option_parser()
        options, _ = parser.parse_args(args)
        manager = NuclideServerManager(options)

        try:
            # Redirect stdout to a stream for capturing.
            original_stdout = sys.stdout
            sys.stdout = stdout_io = StringIO.StringIO()

            self.assertEquals(manager.start_nuclide(), 0)
            return stdout_io.getvalue()
        finally:
            # Restore stdout.
            sys.stdout = original_stdout
    def start_nuclide_server_and_get_outut(self, args):
        parser = nuclide_server_manager.get_option_parser()
        options, _ = parser.parse_args(args)
        manager = NuclideServerManager(options)

        try:
            # Redirect stdout to a stream for capturing.
            original_stdout = sys.stdout
            sys.stdout = stdout_io = StringIO.StringIO()

            self.assertEquals(manager.start_nuclide(), 0)
            return stdout_io.getvalue()
        finally:
            # Restore stdout.
            sys.stdout = original_stdout
Exemplo n.º 3
0
 def test_common_name(self):
     parser = nuclide_server_manager.get_option_parser()
     # Start a Nuclide server using default parameters.
     # It will get a default common name like user.nuclide.host
     options, _ = parser.parse_args([])
     manager = NuclideServerManager(options)
     self.assertEquals(len(manager.list_servers()), 0)
     self.assertEquals(manager.start_nuclide(), 0)
     self.assertEquals(len(manager.list_servers()), 1)
     # Change the default common name and verify it upgrades the existing server.
     options, _ = parser.parse_args(["-n", "localhost"])
     manager = NuclideServerManager(options)
     self.assertEquals(manager.start_nuclide(), 0)
     servers = manager.list_servers()
     self.assertEquals(len(servers), 1)
     # Verify the new common name.
     self.assertEquals(servers[0].get_common_name(), "localhost")
 def test_common_name(self):
     parser = nuclide_server_manager.get_option_parser()
     # Start a Nuclide server using default parameters.
     # It will get a default common name like user.nuclide.host
     options, _ = parser.parse_args([])
     manager = NuclideServerManager(options)
     self.assertEquals(len(manager.list_servers()), 0)
     self.assertEquals(manager.start_nuclide(), 0)
     self.assertEquals(len(manager.list_servers()), 1)
     # Change the default common name and verify it upgrades the existing server.
     options, _ = parser.parse_args(['-n', 'localhost'])
     manager = NuclideServerManager(options)
     self.assertEquals(manager.start_nuclide(), 0)
     servers = manager.list_servers()
     self.assertEquals(len(servers), 1)
     # Verify the new common name.
     self.assertEquals(servers[0].get_common_name(), 'localhost')