Skip to content

Commit 22a90cc

Browse files
committed
Adding tests for —human-readable
1 parent 62886b4 commit 22a90cc

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

features/db-size.feature

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,55 @@ Feature: Display database size
3030
wp_cli_test
3131
"""
3232

33+
Scenario: Display only database size in a human readable format for a WordPress install
34+
Given a WP install
35+
36+
When I run `wp db size --human-readable`
37+
Then STDOUT should contain:
38+
"""
39+
wp_cli_test
40+
"""
41+
42+
And STDOUT should contain:
43+
"""
44+
KB
45+
"""
46+
47+
When I try `wp db size --human-readable --size_format=b`
48+
Then the return code should not be 0
49+
And STDERR should contain:
50+
"""
51+
Cannot use --size_format and --human-readable arguments at the same time.
52+
"""
53+
And STDOUT should be empty
54+
55+
Scenario: Display only table sizes in a human readable format for a WordPress install
56+
Given a WP install
57+
58+
When I run `wp db size --tables --human-readable`
59+
Then STDOUT should contain:
60+
"""
61+
wp_posts
62+
"""
63+
64+
And STDOUT should contain:
65+
"""
66+
KB
67+
"""
68+
69+
But STDOUT should not contain:
70+
"""
71+
wp_cli_test
72+
"""
73+
74+
When I try `wp db size --tables --human-readable --size_format=b`
75+
Then the return code should not be 0
76+
And STDERR should contain:
77+
"""
78+
Cannot use --size_format and --human-readable arguments at the same time.
79+
"""
80+
And STDOUT should be empty
81+
3382
Scenario: Display only database size in bytes for a WordPress install
3483
Given a WP install
3584

0 commit comments

Comments
 (0)