Skip to content
Snippets Groups Projects
Commit 2ba2b431 authored by anonymous's avatar anonymous
Browse files

ODPSH-(16,35): adds unittest for the ValueError, if config string is empty

parent 35f544e9
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,9 @@ import unittest
from ckanext.odsh.harvesters import ckan_mapper as mapper
def value_error():
raise ValueError('Config string can not be empty.')
class TestMappingMethodsStatistikamtNord(unittest.TestCase):
# Files to load
......@@ -17,6 +20,24 @@ class TestMappingMethodsStatistikamtNord(unittest.TestCase):
config_filter = mapper.sta_amt_nord.config_filter
numbers = mapper.sta_amt_nord.numbers
# Test pyjq mapper with invalid StANKategorie
def test_pyjq_mapper_with_invalid_config_string(self):
# Save the data for generating new input for the test
test_dict = self.input_data
# Arrange
self.config_filter = ""
# Act
# Assert
with self.assertRaises(ValueError):
mapper.pyjq_mapper(self.config_filter, test_dict, self.numbers)
value_error
# Test pyjq mapper with invalid StANKategorie
def test_pyjq_mapper_with_invalid_StANKategorie(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment