def test_pool_list(self): pool_command.pool_set( self.parser.parse_args(['pools', 'set', 'foo', '1', 'test'])) with redirect_stdout(io.StringIO()) as stdout: pool_command.pool_list(self.parser.parse_args(['pools', 'list'])) self.assertIn('foo', stdout.getvalue())
def test_pool_list(self): pool_command.pool_set( self.parser.parse_args(['pools', 'set', 'foo', '1', 'test'])) with self.assertLogs(level='INFO') as cm: pool_command.pool_list(self.parser.parse_args(['pools', 'list'])) stdout = cm.output self.assertIn('foo', stdout[0])
def test_pool_delete(self): pool_command.pool_set( self.parser.parse_args(['pools', 'set', 'foo', '1', 'test'])) pool_command.pool_delete( self.parser.parse_args(['pools', 'delete', 'foo'])) self.assertEqual(self.session.query(Pool).count(), 1)
def test_pool_get(self): pool_command.pool_set( self.parser.parse_args(['pools', 'set', 'foo', '1', 'test'])) pool_command.pool_get(self.parser.parse_args(['pools', 'get', 'foo']))
def test_pool_create(self): pool_command.pool_set(self.parser.parse_args(['pools', 'set', 'foo', '1', 'test'])) assert self.session.query(Pool).count() == 2