예제 #1
0
    def test_multiple_drivers_with_different_regions(self):
        driver1 = ElasticHosts("foo", "bar", region="lon-p")
        driver2 = ElasticHosts("foo", "bar", region="sat-p")

        self.assertTrue(driver1.connection.host.startswith("api-lon-p"))
        self.assertTrue(driver2.connection.host.startswith("api-sat-p"))

        driver1.list_nodes()
        driver2.list_nodes()
        driver1.list_nodes()

        self.assertTrue(driver1.connection.host.startswith("api-lon-p"))
        self.assertTrue(driver2.connection.host.startswith("api-sat-p"))
예제 #2
0
    def test_multiple_drivers_with_different_regions(self):
        driver1 = ElasticHosts('foo', 'bar', region='lon-p')
        driver2 = ElasticHosts('foo', 'bar', region='sat-p')

        self.assertTrue(driver1.connection.host.startswith('api-lon-p'))
        self.assertTrue(driver2.connection.host.startswith('api-sat-p'))

        driver1.list_nodes()
        driver2.list_nodes()
        driver1.list_nodes()

        self.assertTrue(driver1.connection.host.startswith('api-lon-p'))
        self.assertTrue(driver2.connection.host.startswith('api-sat-p'))
예제 #3
0
    def setUp(self):
        ElasticHosts.connectionCls.conn_class = ElasticStackMockHttp

        self.driver = ElasticHosts('foo', 'bar')
        images = self.driver.list_images()
        self.image = [i for i in images if
                      i.id == '38df0986-4d85-4b76-b502-3878ffc80161'][0]
        super(ElasticHostsTestCase, self).setUp()
예제 #4
0
 def setUp(self):
     ElasticHosts.connectionCls.conn_classes = (None, ElasticHostsHttp)
     ElasticHostsHttp.type = None
     self.driver = ElasticHosts('foo', 'bar')
     self.node = Node(id=72258,
                      name=None,
                      state=None,
                      public_ip=None,
                      private_ip=None,
                      driver=self.driver)
예제 #5
0
    def setUp(self):
        ElasticHosts.connectionCls.conn_classes = (None, ElasticStackMockHttp)

        self.driver = ElasticHosts('foo', 'bar')
        images = self.driver.list_images()
        self.image = [i for i in images if \
                      i.id == '38df0986-4d85-4b76-b502-3878ffc80161'][0]

        ElasticStackTestCase.setUp(self)
        unittest.TestCase.setUp(self)