Commit 82deb935 authored by Philip ABBET's avatar Philip ABBET
Browse files

Update to the latest version of beat.backend.python

parent 3d229d5b
......@@ -165,6 +165,8 @@ class RestrictedInputGroupTest(unittest.TestCase):
self.assertEqual(len(group), 0)
self.assertEqual(group.data_index, -1)
self.assertEqual(group.data_index_end, -1)
self.assertEqual(group.first_data_index, -1)
self.assertEqual(group.last_data_index, -1)
def test_add_one_input(self):
......@@ -252,6 +254,8 @@ class InputGroupTest(unittest.TestCase):
self.assertEqual(len(group), 0)
self.assertEqual(group.data_index, -1)
self.assertEqual(group.data_index_end, -1)
self.assertEqual(group.first_data_index, -1)
self.assertEqual(group.last_data_index, -1)
def test_creation_with_listener(self):
......@@ -266,6 +270,8 @@ class InputGroupTest(unittest.TestCase):
self.assertEqual(len(group), 0)
self.assertEqual(group.data_index, -1)
self.assertEqual(group.data_index_end, -1)
self.assertEqual(group.first_data_index, -1)
self.assertEqual(group.last_data_index, -1)
self.assertEqual(listener.data_index_start, -1)
self.assertEqual(listener.data_index_end, -1)
......@@ -366,6 +372,9 @@ class InputGroupTest(unittest.TestCase):
self.assertEqual(group.data_index, indices[i][0])
self.assertEqual(group.data_index_end, indices[i][1])
self.assertEqual(group.first_data_index, indices[i][0])
self.assertEqual(group.last_data_index, indices[i][1])
self.assertTrue(input.data is not None)
self.assertEqual(input.data.value, i)
self.assertEqual(input.data_index, indices[i][0])
......@@ -427,6 +436,9 @@ class InputGroupTest(unittest.TestCase):
self.assertEqual(group.data_index, indices[i][0])
self.assertEqual(group.data_index_end, indices[i][1])
self.assertEqual(group.first_data_index, indices[i][0])
self.assertEqual(group.last_data_index, indices[i][1])
self.assertTrue(input1.data is not None)
self.assertEqual(input1.data.value, i)
self.assertEqual(input1.data_index, indices[i][0])
......@@ -517,8 +529,11 @@ class InputGroupTest(unittest.TestCase):
for i in range(0, len(indices1)):
group.next()
self.assertEqual(group.data_index, indices1[i][0])
self.assertEqual(group.data_index_end, indices1[i][1])
self.assertEqual(group.data_index, indices3[0][0])
self.assertEqual(group.data_index_end, indices3[0][1])
self.assertEqual(group.first_data_index, indices1[i][0])
self.assertEqual(group.last_data_index, indices1[i][1])
self.assertTrue(input1.data is not None)
self.assertEqual(input1.data.value, i)
......@@ -560,7 +575,8 @@ class InputGroupTest(unittest.TestCase):
expected_values_1 = [0, 1, 1, 2, 3, 3, 4, 5]
expected_values_2 = [0, 0, 1, 1, 1, 2, 2, 2]
expected_group_indices = [(0, 2), (3, 4), (5, 5), (6, 8), (9, 10), (11, 11), (12, 14), (15, 17)]
expected_group_indices1 = [(0, 4), (0, 5), (3, 10), (5, 10), (5, 11), (9, 17), (11, 17), (11, 17)]
expected_group_indices2 = [(0, 2), (3, 4), (5, 5), (6, 8), (9, 10), (11, 11), (12, 14), (15, 17)]
expected_indices_1 = [(0, 2), (3, 5), (3, 5), (6, 8), (9, 11), (9, 11), (12, 14), (15, 17)]
expected_indices_2 = [(0, 4), (0, 4), (5, 10), (5, 10), (5, 10), (11, 17), (11, 17), (11, 17)]
......@@ -602,8 +618,11 @@ class InputGroupTest(unittest.TestCase):
for i in range(0, len(expected_indices_1)):
group.next()
self.assertEqual(group.data_index, expected_group_indices[i][0])
self.assertEqual(group.data_index_end, expected_group_indices[i][1])
self.assertEqual(group.data_index, expected_group_indices1[i][0])
self.assertEqual(group.data_index_end, expected_group_indices1[i][1])
self.assertEqual(group.first_data_index, expected_group_indices2[i][0])
self.assertEqual(group.last_data_index, expected_group_indices2[i][1])
self.assertTrue(input1.data is not None)
self.assertEqual(input1.data.value, expected_values_1[i])
......@@ -671,8 +690,11 @@ class InputGroupTest(unittest.TestCase):
for i in range(0, len(indices1)):
group.next()
self.assertEqual(group.data_index, indices1[i][0])
self.assertEqual(group.data_index_end, indices1[i][1])
self.assertEqual(group.data_index, indices2[i // 4][0])
self.assertEqual(group.data_index_end, indices2[i // 4][1])
self.assertEqual(group.first_data_index, indices1[i][0])
self.assertEqual(group.last_data_index, indices1[i][1])
self.assertTrue(input1.data is not None)
self.assertEqual(input1.data.value, expected_values_1[i])
......
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