Debian Codegraph @

ansible_collections/community/postgresql/tests/unit/plugins/modules/test_postgresql_set.py

raw
1 # -*- coding: utf-8 -*-
2 # Copyright: (c) 2021, Andrew Klychkov (@Andersson007) <[email protected]>
3
4 from __future__ import absolute_import, division, print_function
5
6 __metaclass__ = type
7
8 import pytest
9 from ansible_collections.community.postgresql.plugins.modules.postgresql_set import \
10 pretty_to_bytes
11
12
13 @pytest.mark.parametrize('input_,expected', [
14 ('', ''),
15 ('test', 'test'),
16 ('0.1', 0.1),
17 ('1024', 1024),
18 ('1024B', 1024),
19 ('1kB', 1024),
20 ('100kB', 102400),
21 ('1MB', 1048576),
22 ('100MB', 104857600),
23 ('1GB', 1073741824),
24 ('10GB', 10737418240),
25 ('127.0.0.1', '127.0.0.1')
26 ]
27 )
28 def test_pretty_to_bytes(input_, expected):
29 assert pretty_to_bytes(input_) == expected