Ejemplo n.º 1
0
def test_commonprefix_single_case():
    swagger = yaml.safe_load("""
swagger: '2.0'
info:
  version: v1.0
  title: my api
paths:
  /v1/path/path3/: {}
    """)

    result = commonprefix(swagger["paths"].keys())
    assert result == "/v1/path/path3"
Ejemplo n.º 2
0
def test_commonprefix_2levels_common():
    swagger = yaml.safe_load("""
swagger: '2.0'
info:
  version: v1.0
  title: my api
paths:
  /v1/path/path3: {}
  /v1/path/path4: {}
    """)

    result = commonprefix(swagger["paths"].keys())
    assert result == "/v1/path"
Ejemplo n.º 3
0
def test_commonprefix_empty():
    result = commonprefix([])
    assert result == ""