def test_name_by_shuffled_numbers_no_files(): result = list(blind.name_by_shuffled_numbers([])) assert result == []
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')
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')]
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')]
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')]