1
1
import os
2
+ import sys
2
3
import stat
3
4
from shutil import rmtree
4
5
5
6
from mock import patch
6
7
from nose .tools import eq_ , raises
8
+ from nose import SkipTest
7
9
from moban .utils import (
8
10
mkdir_p ,
9
11
get_repo_name ,
@@ -25,6 +27,8 @@ def create_file(test_file, permission):
25
27
26
28
27
29
def test_file_permission_copy ():
30
+ if sys .platform == 'win32' :
31
+ raise SkipTest ('No actual chmod on windows' )
28
32
test_source = "test_file_permission_copy1"
29
33
test_dest = "test_file_permission_copy2"
30
34
create_file (test_source , 0o046 )
@@ -44,6 +48,8 @@ def test_file_permissions_file_not_found():
44
48
45
49
46
50
def test_file_permission_copy_symlink ():
51
+ if sys .platform == 'win32' :
52
+ raise SkipTest ('No symlink on windows' )
47
53
test_source = "test_file_permission_copy1"
48
54
test_dest = "test_file_permission_copy2"
49
55
test_symlink = "test_file_permission_symlink"
@@ -92,15 +98,28 @@ def test_expand_dir():
92
98
file_list = [("template-tests" , "abc" , "abc" )]
93
99
template_dirs = [os .path .join ("tests" , "fixtures" )]
94
100
results = list (expand_directories (file_list , template_dirs ))
95
- expected = [("template-tests/a.jj2" , "abc" , "abc/a" )]
101
+ expected = [
102
+ (
103
+ os .path .join ("template-tests" , "a.jj2" ),
104
+ "abc" ,
105
+ os .path .join ("abc" , "a" ),
106
+ )
107
+ ]
96
108
eq_ (results , expected )
97
109
98
110
99
111
def test_get_template_path ():
100
- temp_dirs = ["tests/fixtures/template-tests" , "tests/abc" , "tests/abc" ]
112
+ temp_dirs = [
113
+ os .path .join ("tests" , "fixtures" , "template-tests" ),
114
+ os .path .join ("tests" , "abc" ),
115
+ os .path .join ("tests" , "abc" ),
116
+ ]
101
117
template = "a.jj2"
102
118
template_path = get_template_path (temp_dirs , template )
103
- expected = os .path .join (os .getcwd (), "tests/fixtures/template-tests/a.jj2" )
119
+ expected = os .path .join (
120
+ os .getcwd (),
121
+ os .path .join ("tests" , "fixtures" , "template-tests" , "a.jj2" ),
122
+ )
104
123
eq_ (template_path , expected )
105
124
106
125
0 commit comments