Commit 21923e21 authored by Celine Mercier's avatar Celine Mercier

The unit tests now test for None values

parent 6877fc48
......@@ -47,7 +47,7 @@ def elements_names():
names = ""
for i in range(NB_ELEMENTS_PER_LINE):
names = names + str(i) + ";"
return names
return names[:-1]
def random_obivalue(data_type):
......@@ -82,12 +82,14 @@ class OBIDMS_Column_TestCase(unittest.TestCase):
i=0
for i in range(clone.get_nb_lines_used()) :
assert clone[i] == self.col[i], "Different value in original column and cloned column"
assert clone[i] is not None, "None value"
clone.close()
def test_OBIDMS_column_set_and_get(self):
for i in range(LINE_COUNT_FOR_TEST_COLUMN):
v = random_obivalue(self.data_type_str)
self.col[i] = v
assert self.col[i] == v, "Different value than the set value"
assert self.col[i] is not None, "None value"
class OBIDMS_Column_multiple_elements_TestCase(OBIDMS_Column_TestCase):
......@@ -103,6 +105,7 @@ class OBIDMS_Column_multiple_elements_TestCase(OBIDMS_Column_TestCase):
for i in range(SMALLER_LINE_COUNT_FOR_TEST_COLUMN):
for e in range(NB_ELEMENTS_PER_LINE) :
assert clone.get_item(i, self.elts_names[e]) == self.col.get_item(i, self.elts_names[e]), "Different value in original column and cloned column"
assert clone.get_item(i, self.elts_names[e]) is not None, "None value"
clone.close()
def test_OBIDMS_column_set_and_get(self):
for i in range(SMALLER_LINE_COUNT_FOR_TEST_COLUMN):
......@@ -110,7 +113,7 @@ class OBIDMS_Column_multiple_elements_TestCase(OBIDMS_Column_TestCase):
v = random_obivalue(self.data_type_str)
self.col.set_item(i, self.elts_names[e], v)
assert self.col.get_item(i, self.elts_names[e]) == v, "Different value than the set value"
assert self.col.get_item(i, self.elts_names[e]) is not None, "None value"
class OBIDMS_Column_OBI_INT_TestCase(OBIDMS_Column_TestCase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment