def test_delete_dataset_negative(self):
        """The method is negative test on dataset deletion"""

        with self.assertRaises(urllib.error.HTTPError) as context:
            knoema.delete('non_existing_id')
        self.assertTrue(
            'HTTP Error 400: Bad Request' in str(context.exception))
示例#2
0
    def test_incorrect_host_delete_dataset(self):
        """The method is negative test on delete dataset with incorrect host"""

        with self.assertRaises(ValueError) as context:
            apicfg = knoema.ApiConfig()
            apicfg.host = 'knoema_incorect.com'
            knoema.delete('dataset')
        self.assertTrue("The specified host knoema_incorect.com does not exist" in str(context.exception))