Get the amount of existing existing comments and compare it against maximum & minimum values defined by user
(browser, maximum, minimum, logger)
| 150 | |
| 151 | |
| 152 | def verify_commenting(browser, maximum, minimum, logger): |
| 153 | """ |
| 154 | Get the amount of existing existing comments and |
| 155 | compare it against maximum & minimum values defined by user |
| 156 | """ |
| 157 | |
| 158 | commenting_state, msg = is_commenting_enabled(browser, logger) |
| 159 | if commenting_state is not True: |
| 160 | disapproval_reason = "--> Not commenting! {}".format(msg) |
| 161 | return False, disapproval_reason |
| 162 | |
| 163 | comments_count, msg = get_comments_count(browser, logger) |
| 164 | if comments_count is None: |
| 165 | disapproval_reason = "--> Not commenting! {}".format(msg) |
| 166 | return False, disapproval_reason |
| 167 | |
| 168 | if maximum is not None and comments_count > maximum: |
| 169 | disapproval_reason = "Not commented on this post! ~more comments exist off maximum limit at {}".format( |
| 170 | comments_count |
| 171 | ) |
| 172 | return False, disapproval_reason |
| 173 | |
| 174 | elif minimum is not None and comments_count < minimum: |
| 175 | disapproval_reason = "Not commented on this post! ~less comments exist off minimum limit at {}".format( |
| 176 | comments_count |
| 177 | ) |
| 178 | return False, disapproval_reason |
| 179 | |
| 180 | return True, "Approval" |
| 181 | |
| 182 | |
| 183 | def verify_mandatory_words( |
no test coverage detected