Skip to content

Commit 0368ae6

Browse files
authored
Merge pull request #161 from moremoban/windows-permission
Windows permission
2 parents 4585474 + fdc40d1 commit 0368ae6

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

.moban.cd/changelog.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ releases:
44
- changes:
55
- action: Updated
66
details:
7+
- "`#141`: disable file permissions copy feature and not to check file permission changes on windows."
78
- "`#154`: introduce first ever positional argument for string base template."
89
- "`#157`: the exit code behavior changed. for backward compactibility please use --exit-code. Otherwise, moban will not tell if there is any changes."
9-
date: 11-1-2019
10+
date: 12-1-2019
1011
version: 0.3.8
1112
- changes:
1213
- action: Updated

CHANGELOG.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Change log
22
================================================================================
33

4-
0.3.8 - 11-1-2019
4+
0.3.8 - 12-1-2019
55
--------------------------------------------------------------------------------
66

77
Updated
88
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
99

10+
#. `#141 <https://github.com/moremoban/moban/issues/141>`_: disable file
11+
permissions copy feature and not to check file permission changes on windows.
1012
#. `#154 <https://github.com/moremoban/moban/issues/154>`_: introduce first ever
1113
positional argument for string base template.
1214
#. `#157 <https://github.com/moremoban/moban/issues/157>`_: the exit code

moban/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def file_permissions_copy(source, dest):
126126

127127

128128
def file_permissions(afile):
129+
if sys.platform == "win32":
130+
return "no-permission-support"
129131
if not os.path.exists(afile):
130132
raise exceptions.FileNotFound(afile)
131133
return stat.S_IMODE(os.stat(afile).st_mode)

tests/test_hash_store.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import os
2-
import sys
3-
4-
from nose import SkipTest
52

63
from moban.hashstore import HashStore
74

@@ -80,8 +77,6 @@ def test_dest_file_file_permision_changed(self):
8077
Save as above, but this time,
8178
the generated file had file permision change
8279
"""
83-
if sys.platform == "win32":
84-
raise SkipTest("No actual chmod on windows")
8580
hs = HashStore()
8681
flag = hs.is_file_changed(*self.fixture)
8782
if flag:

tests/test_utils.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ def test_file_permission_copy():
4444
os.unlink(test_dest)
4545

4646

47+
def file_permissions_disabled_on_windows():
48+
if sys.platform == 'win32':
49+
permissions = file_permissions('abc')
50+
eq_('no-permission-support', permissions)
51+
else:
52+
raise SkipTest("No test required")
53+
54+
4755
@raises(FileNotFound)
4856
def test_file_permissions_file_not_found():
4957
file_permissions("I does not exist")

0 commit comments

Comments
 (0)