forked from wberrier/git-svn-ext
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtests
executable file
·64 lines (48 loc) · 2.21 KB
/
tests
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
62
63
64
#!/usr/bin/env python
# There are a lot of formats... test them out with some examples
import unittest
from git_svn_ext import SvnExternal, GitSvnInfo
git_svn_info = GitSvnInfo([
"Path: .",
"URL: svn+ssh://svn.example.com/skin-maker/mydir",
"Repository Root: svn+ssh://svn.example.com/skin-maker",
"Repository UUID: a4bac7da-eecc-44ef-9201-0e2b325a63d8",
"Revision: 1000",
"Node Kind: directory",
"Schedule: normal",
"Last Changed Author: wberrier",
"Last Changed Rev: 1000",
"Last Changed Date: 2012-05-25 15:49:11 -0600 (Fri, 25 May 2012)"
])
class TestSvnExternalParsing(unittest.TestCase):
def setUp(self):
pass
def test1_6_a(self):
ext = SvnExternal("", "-r21 /skin-maker third-party/skins/toolkit", git_svn_info)
self.assertEqual(ext.dir, "third-party/skins/toolkit")
self.assertEqual(ext.rev, "21")
self.assertEqual(ext.url, "svn+ssh://svn.example.com/skin-maker")
def test1_6_b(self):
ext = SvnExternal("", "//svn.example.com/skin-maker@21 third-party/skins/toolkit", git_svn_info)
self.assertEqual(ext.dir, "third-party/skins/toolkit")
self.assertEqual(ext.rev, "21")
self.assertEqual(ext.url, "svn+ssh://svn.example.com/skin-maker")
def test1_6_c(self):
ext = SvnExternal("", "^/subdir@21 third-party/skins/toolkit", git_svn_info)
self.assertEqual(ext.dir, "third-party/skins/toolkit")
self.assertEqual(ext.rev, "21")
self.assertEqual(ext.url, "svn+ssh://svn.example.com/skin-maker/subdir")
def test1_6_d(self):
ext = SvnExternal("", "../subdir@21 third-party/skins/toolkit", git_svn_info)
self.assertEqual(ext.dir, "third-party/skins/toolkit")
self.assertEqual(ext.rev, "21")
self.assertEqual(ext.url, "svn+ssh://svn.example.com/skin-maker/subdir")
def test1_6_e(self):
ext = SvnExternal("", "^/../super-skin-maker@21 third-party/skins/toolkit", git_svn_info)
self.assertEqual(ext.dir, "third-party/skins/toolkit")
self.assertEqual(ext.rev, "21")
self.assertEqual(ext.url, "svn+ssh://svn.example.com/super-skin-maker")
def tearDown(self):
pass
if __name__ == '__main__':
unittest.main()