Exemple #1
0
    def test_package_json_missing(
        self, caplog, patch_module_npm, runway_context, tmp_path
    ):
        """Test package_json_missing."""
        caplog.set_level(logging.DEBUG, logger="runway")
        obj = RunwayModuleNpm(context=runway_context, path=str(tmp_path), options={})

        assert obj.package_json_missing()
        assert ["module is missing package.json"] == caplog.messages

        (tmp_path / "package.json").touch()
        assert not obj.package_json_missing()
Exemple #2
0
    def test_package_json_missing(self, caplog, patch_module_npm,
                                  runway_context, tmp_path):
        """Test package_json_missing."""
        caplog.set_level(logging.WARNING, logger='runway')
        obj = RunwayModuleNpm(context=runway_context,
                              path=str(tmp_path),
                              options={})

        assert obj.package_json_missing()
        assert [
            '{}: Module is missing a "package.json"'.format(tmp_path.name)
        ] == caplog.messages

        (tmp_path / 'package.json').touch()
        assert not obj.package_json_missing()