diff options
author | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2019-01-27 03:51:30 +0100 |
---|---|---|
committer | Wojciech Siewierski <wojciech.siewierski@onet.pl> | 2019-01-27 03:51:30 +0100 |
commit | 725eb3be7a0aa15d6c32534cbbbefcc552e8c12a (patch) | |
tree | 02bbbe0586673b092fff30baa1c8285088a0d5c2 | |
parent | 9d82571b55bde833d0937e5625d0bc778807561a (diff) | |
download | ranger-725eb3be7a0aa15d6c32534cbbbefcc552e8c12a.tar.gz |
Mock the SettingsAware class for one test that accesses the settings
Related issue: #1457
-rw-r--r-- | ranger/ext/human_readable.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ranger/ext/human_readable.py b/ranger/ext/human_readable.py index 6541989e..848f4255 100644 --- a/ranger/ext/human_readable.py +++ b/ranger/ext/human_readable.py @@ -55,6 +55,13 @@ def human_readable(byte, separator=' '): # pylint: disable=too-many-return-stat if __name__ == '__main__': + + # XXX: This mock class is a temporary (as of 2019-01-27) hack. + class SettingsAwareMock(object): # pylint: disable=too-few-public-methods + class settings(object): # pylint: disable=invalid-name,too-few-public-methods + size_in_bytes = False + SettingsAware = SettingsAwareMock # noqa: F811 + import doctest import sys sys.exit(doctest.testmod()[0]) |