From df0f179d41e39fd970029768b2d629a346072bc9 Mon Sep 17 00:00:00 2001 From: Petereon Date: Thu, 17 Mar 2022 19:54:49 +0100 Subject: [PATCH] docs: update documentation in pypi readme --- PYPIREADME.md | 17 ++++++++++++++++- README.md | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/PYPIREADME.md b/PYPIREADME.md index 81b8f14..bfc9952 100644 --- a/PYPIREADME.md +++ b/PYPIREADME.md @@ -62,7 +62,7 @@ Currently available matchers are: - `be_lesser_than(self, value)`: equivalent to "`<`". With alias `be_lesser `, `be_less`, `be_less_than` - `be_greater_or_equal_to(self, value)`: equivalent to "`>=`". With aliases `be_greater_or_equal`, `be_greater_than_or_equal_to` - `be_lesser_or_equal_to(self, value)`: equivalent to "`<=`". With aliases `be_lesser_or_equal`, `be_less_or_equal`, `be_less_than_or_equal_to`, `be_lesser_than_or_equal_to` - - `is_numeric(self)`: checks if `self.value` is a number or string covertible to a number. With alias `be_a_number` + - `be_numeric(self)`: checks if `self.value` is a number or string covertible to a number. With alias `be_a_number` - Containment and Emptiness - `contain(self, value)`: equivalent to "`in`". With aliases `have`, `include` - `be_contained_in(self, value)`: equivalent to "`in`". Qith aliases `be_in`, `be_included_in` @@ -89,3 +89,18 @@ Currently available matchers are: - `to_raise(self, exception_type)` - checks if function raises a specified exception. In each case we have to specify arguments with which function is called in `.when_called_with` method. Method has aliases `when_called_with_args`, `when_called_with_arguments` + +## Filesystem Matchers + +Filesystem matchers can be called as such: +```python +expect.folder('/some/folder').to.contain('subfolder') +``` +Currently available matchers are: +- `contain(self, name, type: Union[File, Folder, None, str] = None)` - checks if folder contains a specified file or folder. If type is specified, it will check if file is file or folder is folder. +- `contain_file(self, name)` - checks if folder contains a specified file. +- `contain_folder(self, name)` - checks if folder contains a specified folder. +- `exist(self)` - checks if folder exists. +- `be_empty(self)` - checks if folder is empty. + +They can be used with both 'expect.folder('/some/folder').to' and 'expect.folder('/some/folder').to_not' to check both positive and negative expectations. \ No newline at end of file diff --git a/README.md b/README.md index 63e08cb..0be0b4f 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,6 @@ Currently available matchers are: In each case we have to specify arguments with which function is called in `.when_called_with` method. Method has aliases `when_called_with_args`, `when_called_with_arguments` -__Project is currently in its infancy, contributors, pull requests and issues are welcome__ - ## Filesystem Matchers Filesystem matchers can be called as such: @@ -129,3 +127,5 @@ Then, package can be built using: ```sh pipenv run build ``` + +__Project is currently in its infancy, contributors, pull requests and issues are welcome__ \ No newline at end of file