コード例 #1
0
def test_parse_input_cannot_deduct(files):
    with pytest.raises(SystemExit):
        input_file, output_file = decrypt._parse_arguments("file1")
コード例 #2
0
def test_parse_ok(files):
    input_file, output_file = decrypt._parse_arguments("file1", "newfile")
    assert input_file == "file1"
    assert output_file == "newfile"
コード例 #3
0
def test_parse_input_dir(files):
    with pytest.raises(SystemExit):
        input_file, output_file = decrypt._parse_arguments("dir2/", "asdf")
コード例 #4
0
def test_parse_output_not_specified(files):
    encrypt.run("file1", "new.gpg")
    input_file, output_file = decrypt._parse_arguments("new.gpg")
    assert output_file == "new"
コード例 #5
0
def test_parse_output_exists(files):
    with pytest.raises(SystemExit):
        decrypt._parse_arguments("file1", "file2")
コード例 #6
0
def test_parse_empty_args(files):
    with pytest.raises(SystemExit):
        decrypt._parse_arguments("", "")
コード例 #7
0
def test_parse_input_not_exists(files):
    with pytest.raises(SystemExit):
        decrypt._parse_arguments("asdf.gpg")