Esempio n. 1
0
def test_service_name_validator():
    assert validate_service_name('foo') == 'foo'
    assert validate_service_name('foo.bar') == 'foo.bar'
    assert validate_service_name('Foo') == 'Foo'
    assert validate_service_name('Foo.Bar') == 'Foo.Bar'
    assert validate_service_name('Foo.a0') == 'Foo.a0'

    with pytest.raises(ValueError):
        validate_service_name('foo.0')

    with pytest.raises(ValueError):
        validate_service_name('0.foo')
Esempio n. 2
0
def test_service_name_validator():
    assert validate_service_name("foo") == "foo"
    assert validate_service_name("foo.bar") == "foo.bar"
    assert validate_service_name("Foo") == "Foo"
    assert validate_service_name("Foo.Bar") == "Foo.Bar"
    assert validate_service_name("Foo.a0") == "Foo.a0"

    with pytest.raises(ValueError):
        validate_service_name("foo.0")

    with pytest.raises(ValueError):
        validate_service_name("0.foo")