Example #1
0
 def test_raise_system_setup_exception_on_invalid_list(self):
     with self.assertRaises(exceptions.SystemSetupError) as ctx:
         rally.convert_hosts(
             ["search.host-a.internal", "search.host-b.internal:9200"])
         self.assertTrue(
             "Could not convert hosts. Invalid format for [search.host-a.internal, "
             "search.host-b.internal:9200]. Expected a comma-separated list of host:port pairs, "
             "e.g. host1:9200,host2:9200." in ctx.exception)
Example #2
0
 def test_can_convert_valid_list(self):
     hosts = rally.convert_hosts(
         ["search.host-a.internal:9200", "search.host-b.internal:9200"])
     self.assertEqual([{
         "host": "search.host-a.internal",
         "port": "9200"
     }, {
         "host": "search.host-b.internal",
         "port": "9200"
     }], hosts)
Example #3
0
 def test_can_convert_valid_list(self):
     hosts = rally.convert_hosts(["search.host-a.internal:9200", "search.host-b.internal:9200"])
     self.assertEqual([{"host": "search.host-a.internal", "port": "9200"}, {"host": "search.host-b.internal", "port": "9200"}], hosts)
Example #4
0
 def test_raise_system_setup_exception_on_invalid_list(self):
     with self.assertRaises(exceptions.SystemSetupError) as ctx:
         rally.convert_hosts(["search.host-a.internal", "search.host-b.internal:9200"])
         self.assertTrue("Could not convert hosts. Invalid format for [search.host-a.internal, "
                         "search.host-b.internal:9200]. Expected a comma-separated list of host:port pairs, "
                         "e.g. host1:9200,host2:9200." in ctx.exception)