Ejemplo n.º 1
0
 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'))
Ejemplo n.º 3
0
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)))
Ejemplo n.º 4
0
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)))
Ejemplo n.º 5
0
 def testDescribeMismatch(self):
     self.assert_describe_mismatch("was <42>", has_item("a"), 42)
Ejemplo n.º 6
0
 def testMismatchDescriptionShowsActualArgument(self):
     self.assert_mismatch_description("was <42>", has_item("a"), 42)
Ejemplo n.º 7
0
 def testSuccessfulMatchDoesNotGenerateMismatchDescription(self):
     self.assert_no_mismatch_description(has_item("a"), self._sequence("a", "b"))
Ejemplo n.º 8
0
 def testHasAReadableDescription(self):
     self.assert_description("a sequence containing 'a'", has_item("a"))
Ejemplo n.º 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())
Ejemplo n.º 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"))
Ejemplo n.º 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")), [])
Ejemplo n.º 12
0
 def testMatchesASequenceThatContainsAnElementMatchingTheGivenMatcher(self):
     self.assert_matches(
         "sequence contains 'a'", has_item(equal_to("a")), self._sequence("a", "b", "c")
     )