Exemplo n.º 1
0
    def test_compare_bonds_equal(self):
        # given
        particles = [uuid.uuid4(), uuid.uuid4()],
        bond = Bond(uid=None,
                    particles=particles,
                    data=create_data_container())
        reference = Bond(uid=None,
                         particles=particles,
                         data=create_data_container())

        # this should pass without problems
        compare_bonds(bond, reference, testcase=self)
Exemplo n.º 2
0
    def test_compare_bonds_equal(self):
        # given
        particles = [uuid.uuid4(), uuid.uuid4()],
        bond = Bond(
            uid=None,
            particles=particles,
            data=create_data_container())
        reference = Bond(
            uid=None,
            particles=particles,
            data=create_data_container())

        # this should pass without problems
        compare_bonds(bond, reference, testcase=self)
Exemplo n.º 3
0
    def test_compare_bonds_not_equal(self):
        # given
        particles = [uuid.uuid4(), uuid.uuid4()],
        bond = Bond(
            uid=uuid.uuid4(),
            particles=particles,
            data=create_data_container())
        reference = Bond(
            uid=uuid.uuid4(),
            particles=particles,
            data=create_data_container())

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

        # given
        bond = Bond(
            uid=reference.uid,
            particles=particles[-1],
            data=create_data_container())

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

        # given
        bond = Bond(
            uid=uuid.uuid4(),
            particles=particles,
            data=DataContainer())

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

        # given
        bond = Bond([None])

        # when/then
        with self.assertRaises(AssertionError):
            compare_bonds(bond, reference, testcase=self)
Exemplo n.º 4
0
    def test_compare_bonds_not_equal(self):
        # given
        particles = [uuid.uuid4(), uuid.uuid4()],
        bond = Bond(uid=uuid.uuid4(),
                    particles=particles,
                    data=create_data_container())
        reference = Bond(uid=uuid.uuid4(),
                         particles=particles,
                         data=create_data_container())

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

        # given
        bond = Bond(uid=reference.uid,
                    particles=particles[-1],
                    data=create_data_container())

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

        # given
        bond = Bond(uid=uuid.uuid4(),
                    particles=particles,
                    data=DataContainer())

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

        # given
        bond = Bond([None])

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