예제 #1
0
 def setUpClass(cls):
     os.environ[
         "APPINSIGHTS_INSTRUMENTATIONKEY"] = "1234abcd-5678-4efa-8abc-1234567890ab"
     cls._base = BaseExporter()
     cls._envelopes_to_export = [
         TelemetryItem(name="Test", time=datetime.now())
     ]
예제 #2
0
 def test_constructor(self):
     """Test the constructor."""
     base = BaseExporter(
         connection_string="InstrumentationKey=4321abcd-5678-4efa-8abc-1234567890ab",
     )
     self.assertEqual(
         base._instrumentation_key,
         "4321abcd-5678-4efa-8abc-1234567890ab",
     )
     self.assertEqual(base.storage._max_size, 52428800)
     self.assertEqual(base.storage._retention_period, 604800)
     self.assertEqual(base._timeout, 10)
예제 #3
0
 def test_constructor_wrong_options(self):
     """Test the constructor with wrong options."""
     with self.assertRaises(TypeError):
         BaseExporter(something_else=6)