Пример #1
0
    def test_compare_particles_datasets_not_equal(self):
        # given
        particles = Particles(name="test")
        reference = Particles(name="test_ref")

        particle_list = create_particles_with_id()
        bond_list = create_bonds()
        data = create_data_container()

        particles.add_particles(particle_list)
        reference.add_particles(particle_list)

        particles.add_bonds(bond_list)
        reference.add_bonds(bond_list)

        particles.data = data
        reference.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_particles = create_particles_with_id()

        particles = Particles(name=reference.name)
        particles.add_particles(test_particles)
        particles.add_bonds(bond_list)
        particles.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_bonds = create_bonds()

        particles = Particles(name=reference.name)
        particles.add_particles(particle_list)
        particles.add_bonds(test_bonds)
        particles.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_data = DataContainer()

        particles = Particles(name=reference.name)
        particles.add_particles(particle_list)
        particles.add_bonds(bond_list)
        particles.data = test_data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)
Пример #2
0
    def test_compare_particles_datasets_not_equal(self):
        # given
        particles = Particles(name="test")
        reference = Particles(name="test_ref")

        particle_list = create_particles_with_id()
        bond_list = create_bonds()
        data = create_data_container()

        particles.add(particle_list)
        reference.add(particle_list)

        particles.add(bond_list)
        reference.add(bond_list)

        particles.data = data
        reference.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_particles = create_particles_with_id()

        particles = Particles(name=reference.name)
        particles.add(test_particles)
        particles.add(bond_list)
        particles.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_bonds = create_bonds()

        particles = Particles(name=reference.name)
        particles.add(particle_list)
        particles.add(test_bonds)
        particles.data = data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)

        # given
        test_data = DataContainer()

        particles = Particles(name=reference.name)
        particles.add(particle_list)
        particles.add(bond_list)
        particles.data = test_data

        # when/then
        with self.assertRaises(AssertionError):
            compare_particles_datasets(particles, reference, testcase=self)
Пример #3
0
    def test_compare_particles_datasets_equal(self):
        # given
        particles = Particles(name="test")
        reference = Particles(name="test")

        particle_list = create_particles_with_id()
        bond_list = create_bonds()
        data = DataContainer()

        particles.add_particles(particle_list)
        reference.add_particles(particle_list)

        particles.add_bonds(bond_list)
        reference.add_bonds(bond_list)

        particles.data = data
        reference.data = data

        # this should pass without problems
        compare_particles_datasets(particles, reference, testcase=self)
Пример #4
0
    def test_compare_particles_datasets_equal(self):
        # given
        particles = Particles(name="test")
        reference = Particles(name="test")

        particle_list = create_particles_with_id()
        bond_list = create_bonds()
        data = DataContainer()

        particles.add(particle_list)
        reference.add(particle_list)

        particles.add(bond_list)
        reference.add(bond_list)

        particles.data = data
        reference.data = data

        # this should pass without problems
        compare_particles_datasets(particles, reference, testcase=self)
Пример #5
0
 def compare_dataset(self, dataset, reference):
     compare_particles_datasets(dataset, reference, self)