async def webhook_reciver(request): obj = DataProvider(dropbox['token'], path) obj.get_newest_monefy_data() data = validator_data.validate_data(obj.download_path) if data: mapper.insert_transactions(data) return json({"message": "updated"}, status=200)
def setUp(self): self.classObj = DataProvider('TOKEN', '', '/', 'manual')
def test_invalid_token_input(self): with self.assertRaises(AssertionError): self.classObj = DataProvider('')
def test_invalid_mode_input(self): with self.assertRaises(AssertionError): self.classObj = DataProvider('TOKEN', '', '/valid', 'invalid')
def test_invalid_working_directory_input(self): with self.assertRaises(AssertionError): self.classObj = DataProvider('TOKEN', '', 'invalid')
def test_invalid_working_directory_type(self): with self.assertRaises(AttributeError): self.classObj = DataProvider('TOKEN', '', 1)
def test_invalid_download_path_type(self): with self.assertRaises(AssertionError): self.classObj = DataProvider('TOKEN', 1)
def test_invalid_token_type(self): with self.assertRaises(TypeError): self.classObj = DataProvider(1)