def test_available__profile_must_be_installed_when_defined(self):
        resource = SCSSFileResource('ftw.theming.tests', 'resources/foo.scss',
                                    profile='foo.bar:default')

        self.assertTrue(resource.available(CONTEXT, REQUEST,
                                           ProfileInfoStub('foo.bar:default')))
        self.assertFalse(resource.available(CONTEXT, REQUEST, ProfileInfoStub()))
 def test_available__request_must_match_layer_interface(self):
     resource = SCSSFileResource('ftw.theming.tests', 'resources/foo.scss',
                                 layer=IDefaultBrowserLayer)
     self.assertTrue(resource.available(CONTEXT, Stub(IDefaultBrowserLayer)))
     self.assertFalse(resource.available(CONTEXT, Stub()))
 def test_available__context_must_match_for_interface(self):
     resource = SCSSFileResource('ftw.theming.tests', 'resources/foo.scss',
                                 for_=INavigationRoot)
     self.assertTrue(resource.available(Stub(INavigationRoot), REQUEST))
     self.assertFalse(resource.available(Stub(), REQUEST))