コード例 #1
0
    def test_parameters(self):
        c = CmdArchiveExtract(ArchiveFormat.zip())
        c.path("path").target("target").exclude("exclude 0").excludes(["exclude 1", "exclude 2"])

        p = params(c)

        assert "path" == p["path"]
        assert "target" == p["destination"]
        assert "exclude 0" in p["exclude_files"]
        assert "exclude 1" in p["exclude_files"]
        assert "exclude 2" in p["exclude_files"]
コード例 #2
0
    def test_command_basics_auto(self):
        c = CmdArchiveExtract(ArchiveFormat.auto())

        assert c.validate()
        assert "archive.auto_extract" == command_name(c)
コード例 #3
0
 def test_command_throws_with_invalid_type(self):
     with pytest.raises(ValueError):
         CmdArchiveExtract(ArchiveFormat("invalid")).validate()
コード例 #4
0
    def test_command_basics_tar(self):
        c = CmdArchiveExtract(ArchiveFormat.tar())

        assert c.validate()
        assert "archive.targz_extract" == command_name(c)