sources for test_svnlook.py [rev. 38799]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import py
from py.__.misc import svnlook
data = py.magic.autopath().dirpath('data')
if py.path.local.sysfind('svnlook') is None or \
       py.path.local.sysfind('svnadmin') is None:
    py.test.skip("cannot test py.misc.svnlook, svn binaries not found")
def test_svnlook():
    tempdir = py.test.ensuretemp("svnlook")
    repo = tempdir.join("repo")
    py.process.cmdexec('svnadmin create --fs-type fsfs "%s"' % repo)
    py.process.cmdexec('svnadmin load "%s" < "%s"' %(repo, 
                       data.join("svnlookrepo.dump")))
    author = svnlook.author(repo, 1) 
    assert author == "hpk"
    
    for item in svnlook.changed(repo, 1): 
        svnurl = item.svnurl()
        assert item.revision == 1
        assert (svnurl.strpath + "/") == "file://%s/%s" %(repo, item.path)
        assert item.added
        assert not item.modified 
        assert not item.propchanged
        assert not item.deleted 
        assert item.path == "testdir/" 
    for item in svnlook.changed(repo, 2): 
        assert item.revision == 2
        assert not item.added
        assert not item.modified 
        assert item.propchanged 
        assert not item.deleted 
        assert item.path == "testdir/" 
    for item in svnlook.changed(repo, 3): 
        assert item.revision == 3
        assert item.added
        assert not item.modified 
        assert not item.propchanged 
        assert not item.deleted 
        assert item.path == "testdir2/" 
    for item in svnlook.changed(repo, 4): 
        assert item.revision == 4
        assert not item.added
        assert not item.modified 
        assert not item.propchanged 
        assert item.deleted 
        assert item.path == "testdir2/" 
    for item in svnlook.changed(repo, 5): 
        assert item.revision == 5
        assert not item.added
        assert not item.modified 
        assert item.propchanged 
        assert not item.deleted 
        assert item.path == "testdir/"