コード例 #1
0
def test_nested_payload_not_allowed(basic_event):
    basic_event['payload'] = {
        'turtle': {
            'turtle': {
                'turtle': {
                    'turtle': 'turtle'
                }
            }
        }
    }
    with pytest.raises(CosmologgerException):
        CosmologEvent.from_dict(basic_event)
コード例 #2
0
def test_invalid_origin(basic_event):
    basic_event['origin'] = 'spaces are not allowed'
    with pytest.raises(CosmologgerException):
        CosmologEvent.from_dict(basic_event)
コード例 #3
0
def test_invalid_stream_name(basic_event):
    basic_event['stream_name'] = '%&^'
    with pytest.raises(CosmologgerException):
        CosmologEvent.from_dict(basic_event)
コード例 #4
0
def test_from_dict(basic_event):
    e = CosmologEvent.from_dict(basic_event)
    assert e == basic_event