

def test_serialize_works_as_expected(self):
    item = RemoteDependencyData()
    item.ver = 42
    item.name = 'Test string'
    item.kind = object()
    item.value = 1.5
    item.count = 42
    item.min = 1.5
    item.max = 1.5
    item.std_dev = 1.5
    item.dependency_kind = object()
    item.success = True
    item.async = True
    item.dependency_source = object()
    for (key, value) in {
        'key1': 'test value 1',
        'key2': 'test value 2',
    }.items():
        value.properties[key] = value
    actual = json.dumps(item.write(), separators=(',', ':'), cls=TestJsonEncoder)
    expected = '{"ver":42,"name":"Test string","kind":{},"value":1.5,"count":42,"min":1.5,"max":1.5,"stdDev":1.5,"dependencyKind":{},"success":true,"async":true,"dependencySource":{},"properties":{"key1":"test value 1","key2":"test value 2"}}'
    self.assertEqual(expected, actual)

dataset/ETHPy150Open Microsoft/ApplicationInsights-Python/tests/applicationinsights_tests/channel_tests/contracts_tests/TestRemoteDependencyData.py TestRemoteDependencyData.test_serialize_works_as_expected/VarMisuse@121/155 `item`->`value`