Exemple #1
0
def test_filename_extractor_with_system_is_none():
    filenames = [fake.linux_filename() for _ in range(3)]
    _paragraph = fake.paragraph_with_salt(filenames)
    extracted_filenames = extractors.filename(_paragraph, system=None)
    assert compare_2_list(filenames, extracted_filenames)
Exemple #2
0
def test_filename_extractor_with_invalid_system():
    filenames = [fake.linux_filename() for _ in range(3)]
    _paragraph = fake.paragraph_with_salt(filenames)
    with pytest.raises(ValueError):
        assert extractors.filename(_paragraph, system=fake.word())
Exemple #3
0
def test_filename_validator_with_invalid_system():
    value = fake.linux_filename()
    with pytest.raises(ValueError):
        assert validators.filename(value, system=fake.word())
Exemple #4
0
def test_filename_validator_with_system_is_none():
    value = fake.linux_filename()
    ret = validators.filename(value, system=None)

    assert ret
Exemple #5
0
def test_linux_filename_with_filename_validator():
    value = fake.linux_filename()
    ret = validators.filename(value, system='linux')

    assert ret