def test_no_args(self): """ test method save without arguments """ self.kill() with self.assertRaises(TypeError) as error: FileStorage.__init__() err = "descriptor '__init__' of 'object' object needs an argument" self.assertEqual(str(error.exception), err)
def test_init_no_args(self): """no args please""" self.resetStorage() with self.assertRaises(TypeError) as e: FileStorage.__init__() msg = "descriptor '__init__' of 'object' object needs an argument" self.assertEqual(str(e.exception), msg)
def test_inittest(self): """Test init method. """ with self.assertRaises(TypeError) as err: FileStorage.__init__() msg = "descriptor '__init__' of 'object' object needs an argument" self.assertEqual(str(err.exception), msg) with self.assertRaises(TypeError) as err: FileStorage("piña") msg = "object() takes no parameters" self.assertEqual(str(err.exception), msg)
def test_noarguments(self): """ tests initialization without arguments """ with self.assertRaises(TypeError) as error: FileStorage.__init__() fail = "descriptor '__init__' of 'object' object needs an argument" self.assertEqual(str(error.exception), fail)
def test_initialize_no_args(self): """ Test no arg input """ self.resetStorage() with self.assertRaises(TypeError): FileStorage.__init__()