@@ -0,0 +1,2424 @@
+import pytest%0A%0Aimport parser.log_file.files_stdout%0A%0Agood_files_text = '''     2    4 drwxr-xr-x  23 root     root         4096 Oct 19 17:23 /%0A123010    4 -rw-r--r--   1 root     root          110 Dec  6 20:22 /a/file%0A  6320    0 crw-rw-rw-   1 root     root              Nov  1 15:58 /a/charfile%0A 13744    0 lrwxrwxrwx   1 root     root            0 Dec  6 20:22 /a/symlink -%3E ../target%0A  7607    0 lrwxrwxrwx   1 root     root           15 Nov  1 15:58 /dev/ignored -%3E /proc/somewhere%0A131001    4 -rw-r--r--   1 root     root          834 Dec 18  2013 /a%5C path%5C with%5C spaces%0A'''%0A%0A@pytest.fixture(scope='function')%0Adef good_files(tmpdir):%0A    p = tmpdir.join('files.log')%0A    p.write(good_files_text)%0A    o = parser.log_file.files_stdout.FilesStdoutLog(str(p))%0A    o.parse()%0A    return o%0A%0Adef test_length(good_files):%0A    assert len(good_files.paths) is 5%0A%0Adef test_in_path(good_files):%0A    assert '/' in good_files.paths%0A%0Adef test_dev_not_in_path(good_files):%0A    assert '/dev/stderr' not in good_files.paths%0A%0A@pytest.fixture(scope='function')%0Adef slash(good_files):%0A    return good_files.paths%5B'/'%5D%0A%0Adef test_slash_path(slash):%0A    assert slash.path == '/'%0A%0Adef test_slash_inode(slash):%0A    assert slash.inode == '2'%0A%0Adef test_slash_blocks(slash):%0A    assert slash.blocks == '4'%0A%0Adef test_slash_perms(slash):%0A    assert slash.perms == 'drwxr-xr-x'%0A%0Adef test_slash_link_count(slash):%0A    assert slash.link_count == '23'%0A%0Adef test_slash_owner(slash):%0A    assert slash.owner == 'root'%0A%0Adef test_slash_group(slash):%0A    assert slash.group == 'root'%0A%0Adef test_slash_size(slash):%0A    assert slash.size == '4096'%0A%0Adef test_slash_month(slash):%0A    assert slash.month == 'Oct'%0A%0Adef test_slash_day(slash):%0A    assert slash.day == '19'%0A%0Adef test_slash_more_time(slash):%0A    assert slash.more_time == '17:23'%0A%0Adef test_slash_no_target(slash):%0A    assert slash.link_target is None%0A%0Adef test_link_target(good_files):%0A    assert good_files.paths%5B'/a/symlink'%5D.link_target == '../target'%0A%0Adef test_char_no_size(good_files):%0A    assert good_files.paths%5B'/a/charfile'%5D.size is None%0A%0Abroken_files_text = '''     2    4 -rwxr-xr-x  23 root     root         4096 Oct 19 17:23 /why so spacey?%0A'''%0A%0Adef test_broken_path(tmpdir):%0A    p = tmpdir.join('files.log')%0A    p.write(broken_files_text)%0A    o = parser.log_file.files_stdout.FilesStdoutLog(str(p))%0A    with pytest.raises(parser.log_file.files_stdout.ParsedFileException):%0A        o.parse()%0A

Add test for files parser