Example #1
0
 def test_can_display_plain_constraint(self, mock_constraint_plain):
     mock_constraint_plain.return_value = "plain"
     self.assertEqual(
         'plain',
         console_report.constraint("rsc_ticket",
                                   "constraint_in_library_representation"))
     mock_constraint_plain.assert_called_once_with(
         "rsc_ticket", "constraint_in_library_representation", True)
Example #2
0
 def test_can_display_constraint_with_set(self, mock_constraint_with_sets):
     mock_constraint_with_sets.return_value = "with_set"
     self.assertEqual(
         'with_set',
         console_report.constraint(
             "rsc_ticket",
             {"resource_sets": "some_resource_sets", "options": {"a": "b"}},
             with_id=False
         )
     )
     mock_constraint_with_sets.assert_called_once_with(
         {"resource_sets": "some_resource_sets", "options": {"a": "b"}},
         False
     )
Example #3
0
 def test_can_display_plain_constraint(self, mock_constraint_plain):
     mock_constraint_plain.return_value = "plain"
     self.assertEqual(
         'plain',
         console_report.constraint(
             "rsc_ticket",
             "constraint_in_library_representation"
         )
     )
     mock_constraint_plain.assert_called_once_with(
         "rsc_ticket",
         "constraint_in_library_representation",
         True
     )
Example #4
0
 def test_can_display_constraint_with_set(self, mock_constraint_with_sets):
     mock_constraint_with_sets.return_value = "with_set"
     self.assertEqual(
         'with_set',
         console_report.constraint("rsc_ticket", {
             "resource_sets": "some_resource_sets",
             "options": {
                 "a": "b"
             }
         },
                                   with_id=False))
     mock_constraint_with_sets.assert_called_once_with(
         {
             "resource_sets": "some_resource_sets",
             "options": {
                 "a": "b"
             }
         }, False)