Exemple #1
0
 def test_can_display_plain_constraint(self, mock_constraint_plain):
     mock_constraint_plain.return_value = "plain"
     self.assertEqual(
         "plain",
         constraint_to_str("rsc_ticket",
                           "constraint_in_library_representation"),
     )
     mock_constraint_plain.assert_called_once_with(
         "rsc_ticket", "constraint_in_library_representation", True)
Exemple #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",
         constraint_to_str(
             "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,
     )