예제 #1
0
파일: test_blind.py 프로젝트: kyleam/blind
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
예제 #2
0
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
def test_name_by_shuffled_numbers_no_files():
    result = list(blind.name_by_shuffled_numbers([]))
    assert result == []
예제 #7
0
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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
파일: test_blind.py 프로젝트: kyleam/blind
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')]