def test_schema_validation_fails_for_wrong_datatype(self):
     data = {'country': 1}
     request = request_factory.get_request(
         data=data,
         context_params={'crud_action': CrudActions.UPDATE_DETAIL})
     response = self.validation.validate_request_data(request)
     assert_that(response.is_success, equal_to(False))
     assert_that(response.data, has_item('country'))
 def test_schema_validation_fails_for_wrong_datatype(self):
     data = {
         'country': 1
     }
     request = request_factory.get_request(data=data,
                                           context_params={
                                           'crud_action': CrudActions.UPDATE_DETAIL})
     response = self.validation.validate_request_data(request)
     assert_that(response.is_success, equal_to(False))
     assert_that(response.data, has_item('country'))
def then_the_cti_is_notified_for_a_configuration_change(step):
    expression = "xivo[cticonfig,update]"
    log_lines = logs.find_line_in_xivo_sysconfd_log()
    assert_that(log_lines, has_item(contains_string(expression)))
def then_the_cti_is_notified_for_a_configuration_change(step):
    expression = "xivo[cticonfig,update]"
    log_lines = logs.find_line_in_xivo_sysconfd_log()
    assert_that(log_lines, has_item(contains_string(expression)))
Example #5
0
 def testDescribeMismatch(self):
     self.assert_describe_mismatch("was <42>", has_item("a"), 42)
Example #6
0
 def testMismatchDescriptionShowsActualArgument(self):
     self.assert_mismatch_description("was <42>", has_item("a"), 42)
Example #7
0
 def testSuccessfulMatchDoesNotGenerateMismatchDescription(self):
     self.assert_no_mismatch_description(has_item("a"), self._sequence("a", "b"))
Example #8
0
 def testHasAReadableDescription(self):
     self.assert_description("a sequence containing 'a'", has_item("a"))
Example #9
0
 def testMatchesAnyConformingSequence(self):
     self.assert_matches("quasi-sequence", has_item(1), QuasiSequence())
     self.assert_does_not_match("non-sequence", has_item(1), object())
Example #10
0
 def testProvidesConvenientShortcutForMatchingWithEqualTo(self):
     self.assert_matches("sequence contains 'a'", has_item("a"), self._sequence("a", "b", "c"))
     self.assert_does_not_match("sequence without 'a'", has_item("a"), self._sequence("b", "c"))
Example #11
0
 def testNoMatchIfSequenceDoesntContainAnElementMatchingTheGivenMatcher(self):
     self.assert_does_not_match(
         "sequence without 'a'", has_item(equal_to("a")), self._sequence("b", "c")
     )
     self.assert_does_not_match("empty", has_item(equal_to("a")), [])
Example #12
0
 def testMatchesASequenceThatContainsAnElementMatchingTheGivenMatcher(self):
     self.assert_matches(
         "sequence contains 'a'", has_item(equal_to("a")), self._sequence("a", "b", "c")
     )