Exemple #1
0
def test_is_not_pending_when_no_flag_file(crunchy_config_dict: dict,
                                          compression_object: CompressionData):
    """Test if SPRING compression is pending when no flag file"""
    # GIVEN a crunchy-api, and a FASTQ file
    crunchy_api = CrunchyAPI(crunchy_config_dict)
    # GIVEN a non existing pending flag
    assert not compression_object.pending_path.exists()

    # WHEN checking if SPRING compression is ongoing
    result = crunchy_api.is_compression_pending(compression_object)

    # THEN result should be False since the pending flag is not there
    assert result is False
Exemple #2
0
def test_is_pending(crunchy_config_dict: dict,
                    compression_object: CompressionData):
    """Test if SPRING compression is pending when pending file exists"""
    # GIVEN a crunchy-api, and FASTQ files
    crunchy_api = CrunchyAPI(crunchy_config_dict)
    # GIVEN a existing pending flag
    compression_object.pending_path.touch()
    assert compression_object.pending_path.exists()

    # WHEN checking if SPRING compression is pending
    result = crunchy_api.is_compression_pending(compression_object)

    # THEN result should be True since the pending_path exists
    assert result is True