Esempio n. 1
0
    def test_from_old_adjacency_list1(self):
        """
        Test we can read an old style adjacency list with implicit hydrogens 1
        """
        adjlist = """
        1 O 0 
        """

  # should be Water
        molecule = Molecule().from_adjacency_list(adjlist)
        self.assertEqual(molecule.get_formula(), 'H2O')
Esempio n. 2
0
    def test_from_intermediate_adjacency_list1(self):
        """
        Test we can read an intermediate style adjacency list with implicit hydrogens 1
        """
        adjlist = """
        1 O 0 2
        """

  # should be Water
        molecule = Molecule().from_adjacency_list(adjlist, saturate_h=True)
        self.assertEqual(molecule.get_formula(), 'H2O')