def test_scale_stoichiometry(self): title = 'A' energy = -100.0 stoichiometry = {'B': 1, 'C': 2} calculation = Calculation(title=title, energy=energy, stoichiometry=stoichiometry) self.assertEqual(calculation.scale_stoichiometry(2), {'B': 2, 'C': 4})
def test_mul( self ): title = 'A' energy = -100.0 stoichiometry = { 'B': 1, 'C': 2 } calculation = Calculation( title=title, energy=energy, stoichiometry=stoichiometry ) calculation.scale_stoichiometry = Mock( return_value={ 'B': 2, 'C': 4 } ) new_calculation = calculation * 2 self.assertEqual( title, new_calculation.title ) self.assertEqual( energy * 2.0, new_calculation.energy ) self.assertEqual( { 'B': 2, 'C': 4 }, new_calculation.stoichiometry ) calculation.scale_stoichiometry.assert_called_with( 2 )
def test_mul(self): title = 'A' energy = -100.0 stoichiometry = {'B': 1, 'C': 2} calculation = Calculation(title=title, energy=energy, stoichiometry=stoichiometry) calculation.scale_stoichiometry = Mock(return_value={'B': 2, 'C': 4}) new_calculation = calculation * 2 self.assertEqual(title, new_calculation.title) self.assertEqual(energy * 2.0, new_calculation.energy) self.assertEqual({'B': 2, 'C': 4}, new_calculation.stoichiometry) calculation.scale_stoichiometry.assert_called_with(2)
def test_scale_stoichiometry( self ): title = 'A' energy = -100.0 stoichiometry = { 'B': 1, 'C': 2 } calculation = Calculation( title=title, energy=energy, stoichiometry=stoichiometry ) self.assertEqual( calculation.scale_stoichiometry( 2 ), { 'B': 2, 'C': 4 } )