Exemple #1
0
    def test_corrupt_data_structures(self):
        """
        Verify when generating the particle, if the particle is corrupt, an exception is raised
        """
        particle = VectorVelocityHeaderDataParticle(
            bad_sample(), port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorSystemDataParticle(bad_sample(),
                                            port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorVelocityDataParticle(bad_sample(),
                                              port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()
    def test_corrupt_data_structures(self):
        """
        Verify when generating the particle, if the particle is corrupt, an exception is raised
        """
        particle = VectorVelocityHeaderDataParticle(bad_sample(), port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorSystemDataParticle(bad_sample(), port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorVelocityDataParticle(bad_sample(), port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()
Exemple #3
0
    def test_corrupt_data_structures(self):
        # garbage is not okay
        particle = VectorVelocityHeaderDataParticle(
            velocity_header_sample().replace(chr(0), chr(1), 1),
            port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorSystemDataParticle(system_sample().replace(
            chr(0), chr(1), 1),
                                            port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()

        particle = VectorVelocityDataParticle(velocity_sample().replace(
            chr(16), chr(17), 1),
                                              port_timestamp=3558720820.531179)
        with self.assertRaises(SampleException):
            particle.generate()
 def test_corrupt_data_structures(self):
     # garbage is not okay
     particle = VectorVelocityHeaderDataParticle(velocity_header_sample().replace(chr(0), chr(1), 1),
                                                 port_timestamp = 3558720820.531179)
     with self.assertRaises(SampleException):
         particle.generate()
      
     particle = VectorSystemDataParticle(system_sample().replace(chr(0), chr(1), 1),
                                         port_timestamp = 3558720820.531179)
     with self.assertRaises(SampleException):
         particle.generate()
      
     particle = VectorVelocityDataParticle(velocity_sample().replace(chr(16), chr(17), 1),
                                           port_timestamp = 3558720820.531179)
     with self.assertRaises(SampleException):
         particle.generate()