# type: test
# title: setup()
# description: probe for prepared attributes
# version: 0.7
# 
# distutils bad

import pytest
import pluginconf
import pluginconf.setup
import setuptools


@pytest.fixture
def pmd():
    return pluginconf.plugin_meta(module="pluginconf")

attr = {}
def _record(**kwargs):
    attr.update(kwargs)


def attributes(mocker, pmd):

    stop = mocker.patch('setuptools.setup', _record)
    pluginconf.setup.setup(
        fn="pluginconf/__init__.py",
        packages = ["pluginconf"],
    )
    
    assert attr["classifiers"]
    assert attr["project_urls"]
    assert attr["packages"] == ['pluginconf']
    assert attr["long_description_content_type"] == 'text/markdown'
    assert attr["license"] == 'PD'
    assert attr["keywords"] == 'config'
    assert attr["long_description"].find("meta data") > 0
