Skip to content

Commit

Permalink
added test for chmod events
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Schott committed Jul 13, 2021
1 parent 0ad7281 commit a796d0c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_emitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

import os
import stat
import time
import pytest
import logging
Expand Down Expand Up @@ -195,6 +196,21 @@ def test_modify():
assert isinstance(event, FileClosedEvent)


@pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter)
def test_chmod():
mkfile(p('a'))
start_watching()

# Note: We use S_IREAD here because chmod on Windows only
# allows setting the read-only flag.
os.chmod(p('a'), stat.S_IREAD)

expect_event(FileModifiedEvent(p('a')))

# Reset permissions to allow cleanup.
os.chmod(p('a'), stat.S_IWRITE)


@pytest.mark.flaky(max_runs=5, min_passes=1, rerun_filter=rerun_filter)
def test_move():
mkdir(p('dir1'))
Expand Down

0 comments on commit a796d0c

Please sign in to comment.