Ejemplo n.º 1
0
 def test_is_match_returns_false_after_range(self):
     mock_context = mock.Mock()
     task = mock.Mock()
     task.index = 785
     self.assertFalse(
         taskindexfilter.TaskIndexRangeFilter(mock_context, 56,
                                              784).is_match(task))
Ejemplo n.º 2
0
 def test_is_match_returns_false_before_range(self):
     mock_context = mock.Mock()
     task = mock.Mock()
     task.index = 1
     self.assertFalse(
         taskindexfilter.TaskIndexRangeFilter(mock_context, 301,
                                              999).is_match(task))
Ejemplo n.º 3
0
 def test_is_match_returns_true_on_end_of_range(self):
     mock_context = mock.Mock()
     task = mock.Mock()
     task.index = 79
     self.assertTrue(
         taskindexfilter.TaskIndexRangeFilter(mock_context, 75,
                                              79).is_match(task))
Ejemplo n.º 4
0
 def test_string_representation_contains_class_and_indexes(self):
     description = str(
         taskindexfilter.TaskIndexRangeFilter(mock.Mock(), 56, 784))
     self.assertIn('TaskIndexRangeFilter', description)
     self.assertIn('56', description)
     self.assertIn('784', description)
Ejemplo n.º 5
0
 def test_constructor_raises_when_range_end_before_start(self):
     with self.assertRaises(Exception):
         taskindexfilter.TaskIndexRangeFilter(mock.Mock(), 345, 23)
Ejemplo n.º 6
0
 def test_constructor_sets_indexes(self):
     target = taskindexfilter.TaskIndexRangeFilter(mock.Mock(), 30, 199)
     self.assertEqual(30, target.start_index)
     self.assertEqual(199, target.end_index)