<commit_before>import unittest

import rmgpy.molecule.parser as parser
from rmgpy.molecule.molecule import Molecule


class parserTest(unittest.TestCase):

   def test_fromAugmentedInChI(self):
      aug_inchi = 'InChI=1S/CH4/h1H4'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(not mol.InChI == '')

      aug_inchi = 'InChI=1/CH4/h1H4'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(not mol.InChI == '')

   def test_OptionalMultLayer(self):
      """Test that multiplicity layer be optional in cases where the layer is not needed."""

      aug_inchi = 'InChI=1S/CH3/h1H3'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 2)

      aug_inchi = 'InChI=1S/CH3/h1H3/mult2'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 2)

      aug_inchi = 'InChI=1S/CH3/h1H3/mult2/u0'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 2)

      aug_inchi = 'InChI=1S/CH2/h1H2/mult3'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 3)

      aug_inchi = 'InChI=1S/CH2/h1H2/mult1'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 1)

      aug_inchi = 'InChI=1S/CH2/h1H2/mult3/u0'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 3)

      aug_inchi = 'InChI=1S/CH2/h1H2/mult1/u0'
      mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
      self.assertTrue(mol.multiplicity == 1)<commit_msg>Fix indentation in parserTest.py.  Use 4 spaces instead of 3 for tabs<commit_after>import unittest

import rmgpy.molecule.parser as parser
from rmgpy.molecule.molecule import Molecule


class parserTest(unittest.TestCase):

    def test_fromAugmentedInChI(self):
        aug_inchi = 'InChI=1S/CH4/h1H4'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(not mol.InChI == '')

        aug_inchi = 'InChI=1/CH4/h1H4'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(not mol.InChI == '')
 
    def test_OptionalMultLayer(self):
        """
        Test that multiplicity layer be optional in cases where the layer is not needed.
        """

        aug_inchi = 'InChI=1S/CH3/h1H3'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 2)
        
        aug_inchi = 'InChI=1S/CH3/h1H3/mult2'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 2)
        
        aug_inchi = 'InChI=1S/CH3/h1H3/mult2/u0'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 2)
        
        aug_inchi = 'InChI=1S/CH2/h1H2/mult3'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 3)
        
        aug_inchi = 'InChI=1S/CH2/h1H2/mult1'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 1)
        
        aug_inchi = 'InChI=1S/CH2/h1H2/mult3/u0'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 3)
        
        aug_inchi = 'InChI=1S/CH2/h1H2/mult1/u0'
        mol = parser.fromAugmentedInChI(Molecule(), aug_inchi)
        self.assertTrue(mol.multiplicity == 1)
{'fraction_non_alphanumeric': 0.11804574978819543, 'fraction_numerical': 0.029935046597006496, 'mean_word_length': 3.0433789954337898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2334350', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1317, 'n_words': 196}