def test_external_refs(self):
     """If a bundle contains absolute paths outside of the
     media directory, to generate a url they are copied in.
     """
     self.env.debug = True
     with TempDirHelper() as h:
         h.create_files(['foo.css'])
         bundle = self.mkbundle(h.path('foo.css'))
         urls = bundle.urls()
         assert len(urls) == 1
         assert re.match(r'.*/webassets-external/[\da-z]*_foo.css', urls[0])
Exemple #2
0
 def test_external_refs(self):
     """If a bundle contains absolute paths outside of the
     media directory, to generate a url they are copied in.
     """
     try:
         from nose.tools import assert_regex
     except ImportError:
         raise SkipTest("Assertion method only present in 2.7+")
     self.env.debug = True
     with TempDirHelper() as h:
         h.create_files(['foo.css'])
         bundle = self.mkbundle(h.path('foo.css'))
         urls = bundle.urls()
         assert len(urls) == 1
         assert_regex(urls[0], r'.*/webassets-external/[\da-z]*_foo.css')