def test_nuclide_server_manager_on_https(self):
     self.start_nuclide_server_twice_and_verify(workspace=".", secure=True)
     manager = NuclideServerManager({})
     servers = manager.list_servers()
     self.assertEquals(len(servers), 1)
     # Must be one of the open ports.
     self.assertTrue(servers[0].port in nuclide_server_manager.OPEN_PORTS)
 def test_nuclide_server_manager_on_https(self):
     self.start_nuclide_server_twice_and_verify(workspace='.', secure=True)
     manager = NuclideServerManager({})
     servers = manager.list_servers()
     self.assertEquals(len(servers), 1)
     # Must be one of the open ports.
     self.assertTrue(servers[0].port in nuclide_server_manager.OPEN_PORTS)
 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')
 def test_nuclide_server_manager_on_http(self):
     self.start_nuclide_server_twice_and_verify(port=9090, workspace=".")
     self.start_nuclide_server_twice_and_verify(port=9091, workspace="..")
     manager = NuclideServerManager({})
     servers = manager.list_servers()
     self.assertEquals(len(servers), 2)
     port0 = servers[0].port
     port1 = servers[1].port
     # A good enough test.
     self.assertEquals(port0 + port1, 9090 + 9091)
 def test_nuclide_server_manager_on_http(self):
     self.start_nuclide_server_twice_and_verify(port=9090, workspace='.')
     self.start_nuclide_server_twice_and_verify(port=9091, workspace='..')
     manager = NuclideServerManager({})
     servers = manager.list_servers()
     self.assertEquals(len(servers), 2)
     port0 = servers[0].port
     port1 = servers[1].port
     # A good enough test.
     self.assertEquals(port0 + port1, 9090 + 9091)