예제 #1
0
 def test_settings_merge_options1(self):
     options = CallOptions(timeout=46)
     settings = CallSettings(timeout=9, page_descriptor=None, retry=None)
     final = settings.merge(options)
     self.assertEqual(final.timeout, 46)
     self.assertIsNone(final.retry)
     self.assertIsNone(final.page_descriptor)
예제 #2
0
 def test_settings_merge_options1(self):
     options = CallOptions(timeout=46)
     settings = CallSettings(timeout=9, page_descriptor=None, retry=None)
     final = settings.merge(options)
     self.assertEqual(final.timeout, 46)
     self.assertIsNone(final.retry)
     self.assertIsNone(final.page_descriptor)
예제 #3
0
 def test_settings_merge_options_page_streaming(self):
     retry = RetryOptions(None, None)
     options = CallOptions(timeout=46, is_page_streaming=False)
     settings = CallSettings(timeout=9, retry=retry)
     final = settings.merge(options)
     self.assertEqual(final.timeout, 46)
     self.assertIsNone(final.page_descriptor)
     self.assertEqual(final.retry, retry)
예제 #4
0
 def test_settings_merge_options2(self):
     retry = RetryOptions(None, None)
     options = CallOptions(retry=retry)
     settings = CallSettings(
         timeout=9, page_descriptor=None, retry=RetryOptions(None, None))
     final = settings.merge(options)
     self.assertEqual(final.timeout, 9)
     self.assertIsNone(final.page_descriptor)
     self.assertEqual(final.retry, retry)
예제 #5
0
 def test_settings_merge_options2(self):
     retry = RetryOptions(None, None)
     options = CallOptions(retry=retry)
     settings = CallSettings(timeout=9,
                             page_descriptor=None,
                             retry=RetryOptions(None, None))
     final = settings.merge(options)
     self.assertEqual(final.timeout, 9)
     self.assertIsNone(final.page_descriptor)
     self.assertEqual(final.retry, retry)
예제 #6
0
 def test_settings_merge_none(self):
     settings = CallSettings(
         timeout=23, page_descriptor=object(), bundler=object(),
         retry=object())
     final = settings.merge(None)
     self.assertEqual(final.timeout, settings.timeout)
     self.assertEqual(final.retry, settings.retry)
     self.assertEqual(final.page_descriptor, settings.page_descriptor)
     self.assertEqual(final.bundler, settings.bundler)
     self.assertEqual(final.bundle_descriptor, settings.bundle_descriptor)
예제 #7
0
 def test_settings_merge_none(self):
     settings = CallSettings(
         timeout=23, page_descriptor=object(), bundler=object(),
         retry=object())
     final = settings.merge(None)
     self.assertEqual(final.timeout, settings.timeout)
     self.assertEqual(final.retry, settings.retry)
     self.assertEqual(final.page_descriptor, settings.page_descriptor)
     self.assertEqual(final.bundler, settings.bundler)
     self.assertEqual(final.bundle_descriptor, settings.bundle_descriptor)
예제 #8
0
 def test_settings_merge_options_page_streaming(self):
     retry = RetryOptions(None, None)
     page_descriptor = object()
     options = CallOptions(timeout=46, page_token=INITIAL_PAGE)
     settings = CallSettings(timeout=9, retry=retry,
                             page_descriptor=page_descriptor)
     final = settings.merge(options)
     self.assertEqual(final.timeout, 46)
     self.assertEqual(final.page_descriptor, page_descriptor)
     self.assertEqual(final.page_token, INITIAL_PAGE)
     self.assertFalse(final.flatten_pages)
     self.assertEqual(final.retry, retry)
예제 #9
0
 def test_settings_merge_options_page_streaming(self):
     retry = RetryOptions(None, None)
     page_descriptor = object()
     options = CallOptions(timeout=46, page_token=INITIAL_PAGE)
     settings = CallSettings(timeout=9,
                             retry=retry,
                             page_descriptor=page_descriptor)
     final = settings.merge(options)
     self.assertEqual(final.timeout, 46)
     self.assertEqual(final.page_descriptor, page_descriptor)
     self.assertEqual(final.page_token, INITIAL_PAGE)
     self.assertFalse(final.flatten_pages)
     self.assertEqual(final.retry, retry)