def test_nbextensionpy_validate(self):
        self._inject_mock_extension('notebook')

        paths = install_nbextension_python('mockextension', user=True)
        enable_nbextension_python('mockextension')

        meta = self._mock_extension_spec_meta()
        warnings = validate_nbextension_python(meta, paths[0])
        self.assertEqual([], warnings, warnings)
    def test_nbextensionpy_validate(self):
        self._inject_mock_extension('notebook')

        paths = install_nbextension_python('mockextension', user=True)
        enable_nbextension_python('mockextension')

        meta = self._mock_extension_spec_meta()
        warnings = validate_nbextension_python(meta, paths[0])
        self.assertEqual([], warnings, warnings)
    def test_nbextensionpy_validate_bad(self):
        # Break the metadata (correct file will still be copied)
        self._inject_mock_extension('notebook')

        paths = install_nbextension_python('mockextension', user=True)

        enable_nbextension_python('mockextension')

        meta = self._mock_extension_spec_meta()
        meta.update(require="bad-require")

        warnings = validate_nbextension_python(meta, paths[0])
        self.assertNotEqual([], warnings, warnings)
    def test_nbextensionpy_validate_bad(self):
        # Break the metadata (correct file will still be copied)
        self._inject_mock_extension('notebook')

        paths = install_nbextension_python('mockextension', user=True)

        enable_nbextension_python('mockextension')

        meta = self._mock_extension_spec_meta()
        meta.update(require="bad-require")

        warnings = validate_nbextension_python(meta, paths[0])
        self.assertNotEqual([], warnings, warnings)