# Path: coaster/assets.py
# _VERSION_SPECIFIER_RE = re.compile('[<=>!*]')
# def split_namespec(namespec):
#     def __init__(self):
#     def _require_recursive(self, *namespecs):
#     def require(self, *namespecs):
#     def setup(self):
#     def output(self, _in, out, **kw):
# class AssetNotFound(Exception):  # noqa: N818
# class VersionedAssets(defaultdict):
# class UglipyJS(Filter):


from io import StringIO
from coaster.assets import AssetNotFound, UglipyJS, Version, VersionedAssets
import unittest
import pytest
            'provides': 'jquery.js',
            'requires': 'jquery.js',
            'bundle': None,
        }
        self.assets['jquery.form.js'][Version('2.96.0')] = (
            'jquery.js',
            'jquery.form-2.96.js',
        )
        self.assets['jquery.form.1.js'][Version('2.96.0')] = {
            'requires': 'jquery.js>=1.8.3',
            'provides': 'jquery.form.js',
        }
        self.assets['old-lib.js'][Version('1.0.0')] = (
            'jquery.js<1.8.0',
            'old-lib-1.0.0.js',
        )

    def test_asset_unversioned(self):
        bundle = self.assets.require('jquery.js')
        assert bundle.contents == ('jquery-1.8.3.js',)

    def test_asset_versioned(self):
        bundle = self.assets.require('jquery.js==1.7.1')
        assert bundle.contents == ('jquery-1.7.1.js',)
        bundle = self.assets.require('jquery.js<1.8.0')
        assert bundle.contents == ('jquery-1.7.1.js',)
        bundle = self.assets.require('jquery.js>=1.8.0')
        assert bundle.contents == ('jquery-1.8.3.js',)

    def test_missing_asset(self):

# Path: coaster/assets.py
# _VERSION_SPECIFIER_RE = re.compile('[<=>!*]')
# def split_namespec(namespec):
#     def __init__(self):
#     def _require_recursive(self, *namespecs):
#     def require(self, *namespecs):
#     def setup(self):
#     def output(self, _in, out, **kw):
# class AssetNotFound(Exception):  # noqa: N818
# class VersionedAssets(defaultdict):
# class UglipyJS(Filter):


# Path: tests/test_assets.py
from io import StringIO
from coaster.assets import AssetNotFound, UglipyJS, Version, VersionedAssets
import unittest
import pytest

            'provides': 'jquery.js',
            'requires': 'jquery.js',
            'bundle': None,
        }
        self.assets['jquery.form.js'][Version('2.96.0')] = (
            'jquery.js',
            'jquery.form-2.96.js',
        )
        self.assets['jquery.form.1.js'][Version('2.96.0')] = {
            'requires': 'jquery.js>=1.8.3',
            'provides': 'jquery.form.js',
        }
        self.assets['old-lib.js'][Version('1.0.0')] = (
            'jquery.js<1.8.0',
            'old-lib-1.0.0.js',
        )

    def test_asset_unversioned(self):
        bundle = self.assets.require('jquery.js')
        assert bundle.contents == ('jquery-1.8.3.js',)

    def test_asset_versioned(self):
        bundle = self.assets.require('jquery.js==1.7.1')
        assert bundle.contents == ('jquery-1.7.1.js',)
        bundle = self.assets.require('jquery.js<1.8.0')
        assert bundle.contents == ('jquery-1.7.1.js',)
        bundle = self.assets.require('jquery.js>=1.8.0')
        assert bundle.contents == ('jquery-1.8.3.js',)

    def test_missing_asset(self):

        with pytest.raises(AssetNotFound):