def test_duplicate_files():
    """Test that duplicate files in a package are caught."""

    package = MagicMock()
    package.zf = zf = MagicMock()
    zf.namelist.return_value = ["foo.bar", "foo.bar"]

    err = ErrorBundle()
    packagelayout.test_layout_all(err, package)
    assert err.failed()
Ejemplo n.º 2
0
def test_duplicate_files():
    """Test that duplicate files in a package are caught."""

    package = MagicMock()
    package.subpackage = False
    zf = MagicMock()
    zf.namelist.return_value = ["foo.bar", "foo.bar"]
    package.zf = zf

    err = ErrorBundle()
    packagelayout.test_layout_all(err, package)
    assert err.failed()
Ejemplo n.º 3
0
    def test_metainf_fail(self):
        """Test that META-INF directories fail validation."""

        self.package.zf.namelist.return_value = ["META-INF/foo.js"]
        packagelayout.test_layout_all(self.err, self.package)
        self.assert_failed(with_errors=True)
Ejemplo n.º 4
0
 def test_metainf_pass(self):
     self.package.zf.namelist.return_value = ["META-INF-foo.js"]
     packagelayout.test_layout_all(self.err, self.package)
     self.assert_silent()
Ejemplo n.º 5
0
    def test_metainf_fail(self):
        """Test that META-INF directories fail validation."""

        self.package.zf.namelist.return_value = ["META-INF/foo.js"]
        packagelayout.test_layout_all(self.err, self.package)
        self.assert_failed(with_errors=True)
Ejemplo n.º 6
0
 def test_metainf_pass(self):
     self.package.zf.namelist.return_value = ["META-INF-foo.js"]
     packagelayout.test_layout_all(self.err, self.package)
     self.assert_silent()