def test_update_config(config): default = Config() tags = [ { "name": "mouse", "description": "first create a house using the house API then you can create a mouse", }, { "name": "house", "description": "create somewhere for people and mice to live", }, ] config.update( title="demo", version="latest", info={"description": "describe my api"}, tags=tags, ) assert config.DOMAIN is None assert config.FILENAME == default.FILENAME assert config.TITLE == "demo" assert config.VERSION == "latest" assert config.INFO["description"] == "describe my api" assert config.TAGS[1]["name"] == "house" config.update(unknown="missing") with pytest.raises(AttributeError): assert config.unknown
def test_spectree_init(): spec = SpecTree(path='docs') conf = Config() assert spec.config.TITLE == conf.TITLE assert spec.config.PATH == 'docs' with pytest.raises(NotImplementedError): SpecTree(app=conf)
def test_update_config(config): default = Config() config.update(title="demo", version="latest") assert config.DOMAIN is None assert config.FILENAME == default.FILENAME assert config.TITLE == "demo" assert config.VERSION == "latest" config.update(unknown="missing") with pytest.raises(AttributeError): assert config.unknown
def test_update_config(config): default = Config() config.update(title='demo', version='latest') assert config.DOMAIN is None assert config.FILENAME == default.FILENAME assert config.TITLE == 'demo' assert config.VERSION == 'latest' config.update(unknown='missing') with pytest.raises(AttributeError): assert config.unknown
def config(): return Config()
def test_spectree_init(): spec = SpecTree(path="docs") conf = Config() assert spec.config.TITLE == conf.TITLE assert spec.config.PATH == "docs"