def test_region(self):
        client = AnalyticsClient.create('foo', 'bar')

        self.assertEqual(client._config._region, 'us')

        client = AnalyticsClient.create('foo', 'bar', 'fr')

        self.assertEqual(client._config._region, 'fr')
Exemplo n.º 2
0
    def test_region(self):
        client = AnalyticsClient.create("foo", "bar")

        self.assertEqual(client._config._region, "us")

        client = AnalyticsClient.create("foo", "bar", "fr")

        self.assertEqual(client._config._region, "fr")
    def test_region(self):
        client = AnalyticsClient.create('foo', 'bar')

        self.assertEqual(
            client._config._region, 'us')

        client = AnalyticsClient.create('foo', 'bar', 'fr')

        self.assertEqual(
            client._config._region, 'fr')
Exemplo n.º 4
0
    def analytics_client(app_id=None, api_key=None):
        # type: (Optional[str], Optional[str]) -> AnalyticsClient

        app_id = app_id if app_id is not None else Factory.get_app_id()
        api_key = api_key if api_key is not None else Factory.get_api_key()

        return Factory.decide(AnalyticsClient.create(app_id, api_key))
    def test_create_with_config(self):
        config = SearchConfig('foo', 'bar')

        self.assertIsInstance(
            AnalyticsClient.create_with_config(config),
            AnalyticsClient
        )
    def analytics_client(app_id=None, api_key=None):
        # type: (Optional[str], Optional[str]) -> AnalyticsClient

        app_id = app_id if app_id is not None else Factory.get_app_id()
        api_key = api_key if api_key is not None else Factory.get_api_key()

        return Factory.decide(AnalyticsClient.create(app_id, api_key))
    def __init__(self, analytics_client, transporter, search_config):
        # type: (AnalyticsClient, TransporterAsync, AnalyticsConfig) -> None

        self._transporter_async = transporter

        super(AnalyticsClientAsync,
              self).__init__(analytics_client._transporter, search_config)

        client = AnalyticsClient(transporter, search_config)

        _create_async_methods_in(self, client)
 def setUp(self):
     self.client = AnalyticsClient.create('foo', 'bar')
 def test_create(self):
     self.assertIsInstance(self.client, AnalyticsClient)
     with self.assertRaises(AssertionError) as _:
         AnalyticsClient.create('', '')
Exemplo n.º 10
0
 def setUp(self):
     self.client = AnalyticsClient.create("foo", "bar")
Exemplo n.º 11
0
    def test_create_with_config(self):
        config = SearchConfig("foo", "bar")

        self.assertIsInstance(AnalyticsClient.create_with_config(config),
                              AnalyticsClient)
Exemplo n.º 12
0
 def test_create(self):
     self.assertIsInstance(self.client, AnalyticsClient)
     with self.assertRaises(AssertionError) as _:
         AnalyticsClient.create("", "")
 def setUp(self):
     self.client = AnalyticsClient.create('foo', 'bar')