Exemple #1
0
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
Exemple #2
0
def test_name_by_shuffled_numbers_ten_files():
    with mock.patch('random.shuffle'):
        files = ['{}.txt'.format(i) for i in range(10)]
        result = list(blind.name_by_shuffled_numbers(files))
        assert result[0] == ('0.txt', '00.txt')
Exemple #3
0
def test_name_by_shuffled_numbers_two_files_with_path():
    with mock.patch('random.shuffle'):
        files = ['/path/one.txt', '/path/two.csv']
        result = list(blind.name_by_shuffled_numbers(files))
        assert result == [('/path/one.txt', '/path/0.txt'),
                          ('/path/two.csv', '/path/1.csv')]
Exemple #4
0
def test_name_by_shuffled_numbers_one_file():
    files = ['one.txt']
    result = list(blind.name_by_shuffled_numbers(files))
    assert result == [('one.txt', '0.txt')]
Exemple #5
0
def test_name_by_shuffled_numbers_two_files():
    with mock.patch('random.shuffle'):
        files = ['one.txt', 'two.csv']
        result = list(blind.name_by_shuffled_numbers(files))
        assert result == [('one.txt', '0.txt'), ('two.csv', '1.csv')]
Exemple #6
0
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
Exemple #7
0
def test_name_by_shuffled_numbers_two_files_with_path():
    with mock.patch('random.shuffle'):
        files = ['/path/one.txt', '/path/two.csv']
        result = list(blind.name_by_shuffled_numbers(files))
        assert result == [('/path/one.txt', '/path/0.txt'),
                          ('/path/two.csv', '/path/1.csv')]
Exemple #8
0
def test_name_by_shuffled_numbers_ten_files():
    with mock.patch('random.shuffle'):
        files = ['{}.txt'.format(i) for i in range(10)]
        result = list(blind.name_by_shuffled_numbers(files))
        assert result[0] == ('0.txt', '00.txt')
Exemple #9
0
def test_name_by_shuffled_numbers_two_files():
    with mock.patch('random.shuffle'):
        files = ['one.txt', 'two.csv']
        result = list(blind.name_by_shuffled_numbers(files))
        assert result == [('one.txt', '0.txt'), ('two.csv', '1.csv')]
Exemple #10
0
def test_name_by_shuffled_numbers_one_file():
    files = ['one.txt']
    result = list(blind.name_by_shuffled_numbers(files))
    assert result == [('one.txt', '0.txt')]