示例#1
0
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
示例#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')
示例#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')]
示例#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')]
示例#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')]
示例#6
0
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
示例#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')]
示例#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')
示例#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')]
示例#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')]