| Conditions | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | from lib.actions import BaseAction |
||
| 5 | def run(self, title, body, topic=None, status=0): |
||
| 6 | if topic: |
||
| 7 | topic = self._convert_slug(topic) |
||
| 8 | path = '/topics/%s/articles' % topic |
||
| 9 | else: |
||
| 10 | path = '/articles' |
||
| 11 | payload = self._create_article(title=title, body=body, status=status) |
||
| 12 | response = self._api_post(path, json=payload) |
||
| 13 | return response |
||
| 14 | |||
| 24 |