Beispiel #1
0
    def test_it_should_assert_has_layer_for_invalid_arguments(self):
        try:
            assertions.assertHasLayer(ICMPv6EchoRequest,
                                      IPv6() / ICMPv6ParamProblem())

            self.fail(
                'did not identify that "::1 > ::1 (58) / ICMPv6ParamProblem" does not have layer ICMPv6EchoRequest'
            )
        except assertions.AssertionFailedError, e:
            self.assertEqual(
                'expected "::1 > ::1 (58) / ICMPv6ParamProblem" to have layer ICMPv6EchoRequest',
                e.message)
Beispiel #2
0
 def test_it_should_assert_has_layer_for_valid_arguments(self):
     self.assertEqual(
         True,
         assertions.assertHasLayer(ICMPv6EchoRequest,
                                   IPv6() / ICMPv6EchoRequest()),
         'did not identify that IPv6()/ICMPv6EchoRequest packet has ICMPv6EchoRequest layer'
     )