import unittest

from . import mixin


class IotApiTest(mixin.AioMixin, unittest.IsolatedAsyncioTestCase):
    async def test_01(self):
        resp = await self.api.vuln_update()
        self.assertEqual(resp.status, 400)

    async def test_02(self):
        json = '{"ticketIdList":[]}'
        resp = await self.api.vuln_update(json=json)
        self.assertEqual(resp.status, 400)
        x = await resp.json()
        msg = await resp.text()
        try:
            self.assertGreater(len(x['validations']['body']), 0, msg)
        except KeyError as e:
            self.fail('KeyError %s: %s' % (e, msg))
