def _test_archive_deleted_rows(self, mock_db_archive, verbose=False):
self.useFixture(fixtures.MonkeyPatch('sys.stdout', StringIO()))
self.commands.archive_deleted_rows(20, verbose=verbose)
mock_db_archive.assert_called_once_with(20)
output = sys.stdout.getvalue()
if verbose:
expected = '''\
+-----------+-------------------------+
| Table | Number of Rows Archived |
+-----------+-------------------------+
| consoles | 5 |
| instances | 10 |
+-----------+-------------------------+
'''
self.assertEqual(expected, output)
else:
self.assertEqual(0, len(output))
test_nova_manage.py 文件源码
python
阅读 31
收藏 0
点赞 0
评论 0
评论列表
文章目录