def test_intinterval_contains_6(self): interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) interval2 = cei._intervalise(_INTEGER_LIST_5) self.assertFalse(interval.contains(interval2))
def test_intervalise_2(self): expected_subint = [[5, 5]] calc_interval = cei._intervalise(_INTEGER_1) calc_subint = cei._intervalise(calc_interval).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_union_5(self): expected_subint = [[5, 12], [20, 22]] interval = cei._intervalise(_INTEGER_LIST_1) calc_subint = interval.union(_INTEGER_LIST_4).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_addtag_1(self): interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) interval.addtag(_STRING_2, _STRING_1) self.assertTrue(_STRING_2 in interval.tags) self.assertEqual(interval.tags[_STRING_2], _STRING_1)
def test_intinterval_description_2(self): interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) interval.description(_STRING_1) self.assertTrue('description' in interval.tags) self.assertEqual(interval.tags['description'], _STRING_1)
def test_intinterval_n_elements_1(self): expected_number = 8 interval = cei._intervalise(_INTEGER_LIST_1) calc_number = interval.n_elements() self.assertEqual(calc_number, expected_number)
def test_intinterval_terminals_1(self): expected_subint = [5, 12] interval = cei._intervalise(_INTEGER_LIST_1) calc_subint = interval.terminals() self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_intersection_1(self): expected_subint = [[5, 5]] interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) calc_subint = interval.intersection(_INTEGER_1).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_deltag_1(self): interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) interval.addtag(_STRING_2, _STRING_1) interval.deltag(_STRING_2) self.assertFalse(_STRING_2 in interval.tags)
def test_intinterval_symdiff_8(self): expected_subint = [[5, 10], [13, 19], [23, 25]] interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) calc_subint = interval.symdiff(_INTEGER_LIST_5).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_symdiff_6(self): expected_subint = [[1, 4], [7, 12], [20, 22]] interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) calc_subint = interval.symdiff(_INTEGER_LIST_3).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_subtract_8(self): expected_subint = [[5, 10]] interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) calc_subint = interval.subtract(_INTEGER_LIST_5).subint self.assertListEqual(calc_subint, expected_subint)
def test_intervalise_4(self): expected_subint = [[5, 12]] calc_subint = cei._intervalise(_INTEGER_LIST_2).subint self.assertListEqual(calc_subint, expected_subint)
def test_intinterval_contains_3(self): interval = cei._intervalise(_INTEGER_LIST_1) interval = interval.union(_INTEGER_LIST_4) self.assertTrue(interval.contains(_INTEGER_LIST_1))