Esempio n. 1
0
    def test_register_connection_ok(self):
        register_connection(
            self.alias, host=self.host, port=self.port
        )

        space = get_space(self.alias, reconnect=True)
        self.assert_space(space, self.space)
Esempio n. 2
0
    def test_register_connection_invalid_port(self):
        invalid_port = 'port'

        with self.assertRaises(ValueError):
            register_connection(
                self.alias, host=self.host, port=invalid_port
            )
Esempio n. 3
0
    def test_register_connection(self):
        expected_connection_settings = {
            'host': self.host,
            'port': self.port,
            'space': self.space
        }

        connection_settings = register_connection(
            self.alias, host=self.host, port=self.port
        )
        self.assertEqual(connection_settings, expected_connection_settings)
Esempio n. 4
0
    def test_register_connection(self):
        expected_connection_settings = {
            'host': self.host,
            'port': self.port,
            'space': self.space
        }

        connection_settings = register_connection(self.alias,
                                                  host=self.host,
                                                  port=self.port)
        self.assertEqual(connection_settings, expected_connection_settings)
Esempio n. 5
0
    def setUp(self):
        self.tnt_config = {
            'host': '127.0.0.1',
            'port': 33013,
        }
        self.another_space_alias = 'the_new_space'
        self.composite_primary_key_alias = 'composite_primary_key'

        register_connection(DEFAULT_ALIAS, space=0, **self.tnt_config)
        register_connection(self.another_space_alias,
                            space=1,
                            **self.tnt_config)
        register_connection(self.composite_primary_key_alias,
                            space=2,
                            **self.tnt_config)

        self.space = get_space(DEFAULT_ALIAS)
        self.another_space = get_space(self.another_space_alias)
        self.composite_primary_key_space = get_space(
            self.composite_primary_key_alias)
Esempio n. 6
0
    def setUp(self):
        self.tnt_config = {
            'host': '127.0.0.1',
            'port': 33013,
        }
        self.another_space_alias = 'the_new_space'
        self.composite_primary_key_alias = 'composite_primary_key'

        register_connection(
            DEFAULT_ALIAS, space=0, **self.tnt_config
        )
        register_connection(
            self.another_space_alias, space=1, **self.tnt_config
        )
        register_connection(
            self.composite_primary_key_alias, space=2, **self.tnt_config
        )

        self.space = get_space(DEFAULT_ALIAS)
        self.another_space = get_space(self.another_space_alias)
        self.composite_primary_key_space = get_space(self.composite_primary_key_alias)
Esempio n. 7
0
    def test_register_connection_invalid_port(self):
        invalid_port = 'port'

        with self.assertRaises(ValueError):
            register_connection(self.alias, host=self.host, port=invalid_port)
Esempio n. 8
0
    def test_register_connection_ok(self):
        register_connection(self.alias, host=self.host, port=self.port)

        space = get_space(self.alias, reconnect=True)
        self.assert_space(space, self.space)