Esempio n. 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)
Esempio n. 2
0
def test_invalid_origin(basic_event):
    basic_event['origin'] = 'spaces are not allowed'
    with pytest.raises(CosmologgerException):
        CosmologEvent.from_dict(basic_event)
Esempio n. 3
0
def test_invalid_stream_name(basic_event):
    basic_event['stream_name'] = '%&^'
    with pytest.raises(CosmologgerException):
        CosmologEvent.from_dict(basic_event)
Esempio n. 4
0
def test_from_dict(basic_event):
    e = CosmologEvent.from_dict(basic_event)
    assert e == basic_event