Esempio n. 1
0
 def test_mismatch_output_utf8(self):
     """The mismatch has utf output."""
     self.skip("mismatch Contains returns ascii error")
     attr = make_fake_attribute_with_result(str("阿布从1"), 'wait_for')
     mismatch = Eventually(Equals('\u963f\u5e03\u4ece'),
                           timeout=.5).match(attr)
     self.assertThat(mismatch.describe(), Contains("阿布从11"))
Esempio n. 2
0
 def test_mismatch_with_bool(self):
     """The mismatch value must fail boolean values."""
     attr = make_fake_attribute_with_result(False, 'wait_for')
     mismatch = Eventually(Equals(True), timeout=1).match(attr)
     self.assertThat(mismatch.describe(), Contains("failed"))
Esempio n. 3
0
 def test_mismatch_with_unicode(self):
     """The mismatch value must fail with str and unicode mix."""
     attr = make_fake_attribute_with_result(str("阿布从1"), 'wait_for')
     mismatch = Eventually(Equals('\u963f\u5e03\u4ece'),
                           timeout=.5).match(attr)
     self.assertThat(mismatch.describe(), Contains('failed'))
Esempio n. 4
0
 def test_mismatch_message_has_correct_timeout_value(self):
     """The mismatch value must have the correct timeout value in it."""
     attr = make_fake_attribute_with_result(False, self.attribute_type)
     mismatch = Eventually(Equals(True), timeout=1).match(attr)
     self.assertThat(mismatch.describe(),
                     Contains("After 1.0 seconds test"))