Exemplo n.º 1
0
 def test_constructor_no_arguments(self):
     mismatch = Mismatch()
     self.assertThat(mismatch.describe,
                     Raises(MatchesException(NotImplementedError)))
     self.assertEqual({}, mismatch.get_details())
Exemplo n.º 2
0
 def test_forwards_description(self):
     x = Mismatch("description", {'foo': 'bar'})
     decorated = MismatchDecorator(x)
     self.assertEqual(x.describe(), decorated.describe())
Exemplo n.º 3
0
 def test_constructor_arguments(self):
     mismatch = Mismatch("some description", {'detail': "things"})
     self.assertEqual("some description", mismatch.describe())
     self.assertEqual({'detail': "things"}, mismatch.get_details())
Exemplo n.º 4
0
 def test_repr(self):
     x = Mismatch("description", {'foo': 'bar'})
     decorated = MismatchDecorator(x)
     self.assertEqual(
         '<testtools.matchers.MismatchDecorator({!r})>'.format(x),
         repr(decorated))
Exemplo n.º 5
0
 def test_constructor_no_arguments(self):
     mismatch = Mismatch()
     self.assertThat(mismatch.describe,
         Raises(MatchesException(NotImplementedError)))
     self.assertEqual({}, mismatch.get_details())
Exemplo n.º 6
0
 def test_constructor_arguments(self):
     mismatch = Mismatch("some description", {'detail': "things"})
     self.assertEqual("some description", mismatch.describe())
     self.assertEqual({'detail': "things"}, mismatch.get_details())
Exemplo n.º 7
0
 def test_forwards_details(self):
     x = Mismatch("description", {'foo': 'bar'})
     decorated = MismatchDecorator(x)
     self.assertEqual(x.get_details(), decorated.get_details())