Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for named pipes and sockets #10

Merged
merged 1 commit into from
Aug 20, 2017

Conversation

nehaljwani
Copy link
Contributor

This commits adds asserts for named pipe (FIFO) and socket file types.

Copy link
Member

@takluyver takluyver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - other than some issues with the docstrings, I think this looks good.

raise AssertionError(msg)

def assert_issocket(path, follow_symlinks=True, msg=None):
"""Assert that path exists and is a named pipe (FIFO).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docstrings should probably say 'Unix domain socket' rather than 'named pipe'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"""Assert that path exists and is a named pipe (FIFO).

With follow_symlinks=True, the default, this will pass if path is a symlink
to a regular file. With follow_symlinks=False, it will fail in that case.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'regular file' -> 'named pipe'

Similarly in all four of the new docstrings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@takluyver
Copy link
Member

Thanks!

@takluyver takluyver merged commit 47472b1 into jupyter:master Aug 20, 2017
@nehaljwani nehaljwani deleted the pipes_and_sockets branch August 20, 2017 13:27
@takluyver
Copy link
Member

I've added them to the docs as well:
http://testpath.readthedocs.io/en/latest/fsasserts.html#unix-specific

@nehaljwani
Copy link
Contributor Author

Ah! A new release already! Cool 👍

@takluyver
Copy link
Member

I haven't actually done a release yet - I'll give it a little while in case there's other things to add soon. But I'm pre-emptively marking them as 'new in' to give people reading the docs a hint why those functions aren't there for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants