def test_can_get_pairwise_atoms(self, mock_atoms): mock_atoms.return_value = set(self.atoms) structure = AtomStructure(self.atom1, self.atom2, self.atom3) collected_atoms = [] for pair in structure.pairwise_atoms(a=1, b=2): collected_atoms += list(pair) for atom in self.atoms: self.assertEqual(collected_atoms.count(atom), 2) mock_atoms.assert_called_with(a=1, b=2)
def test_can_get_pairwise_atoms_one(self, mock_atoms): mock_atoms.return_value = set(self.atoms[:1]) structure = AtomStructure(self.atom1) self.assertEqual(len(list(structure.pairwise_atoms())), 0)