Skip to content

Latest commit

 

History

History
90 lines (79 loc) · 2.67 KB

File metadata and controls

90 lines (79 loc) · 2.67 KB

Tests

experiments.py

  • TestMatrix()
    • __init__()
      • num_replicates <= 0
        • ValueError('bad number of replicates')
          • <0
          • = 0
      • Non-iterable equivalence
        • creates iterable (len(self.equivalence) gives no error)
      • Iterable equivalence with non-numeric
        • TypeError('equivalence has non-numeric items')
      • equivalence <= 0
        • ValueError('equivalence <= 0')
          • <0
          • =0
      • Non-iterable diluent_mole_fraction
        • creates iterable (len(self.diluent_mole_fraction) gives no error)
      • Iterable diluent_mole_fraction with non-numeric
        • TypeError('diluent_mole_fraction has non-numeric items')
      • diluent_mole_fraction outside of [0, 1)
        • bad
          • ValueError('diluent mole fraction outside of [0, 1)')
          • <0
          • >1
          • =1
        • good
          • =0
          • =0.99
    • _build_replicate()
      • compare output current_replicate to hand-calcs
        • diluted
        • undiluted
    • generate_test_matrices()
      • self.replicates contains no None
      • each replicate contains the same items
      • each replicate is in a different order
    • save()
      • files write to disk as expected (delete)

thermochem.py

  • calculate_laminar_flamespeed()

    • move tests from test_tools.py
  • calculate_get_eq_sound_speed()

    • move tests from test_tools.py
  • Mixture

    • __init__()
      • no unit registry is given
      • unit registry is given
      • bad fuel
        • ValueError('Bad fuel')
      • bad oxidizer
        • ValueError('Bad oxidizer')
      • bad diluent
        • ValueError('Bad diluent')
      • diluent and mole fraction are given
        • self.diluted not None
      • diluent and mole fraction not given
        • self.diluted is None
    • set_equivalence()
      • contains nothing very special, will get all branches run through as long as:
        • successful __init__ without dilution
        • successful __init__ with dilution
    • add_diluent()
      • bad diluent
        • ValueError('Bad diluent: {}'.format(diluent))
      • diluent is fuel or oxidizer
        • ValueError('You can't dilute with fuel or oxidizer!')
          • fuel
          • oxidizer
      • mole fraction > 1
        • ValueError('Bro, do you even mole fraction?')
    • get_mass()
      • compare against hand calcs
        • undiluted
        • diluted
    • get_pressures()
      • compare against hand calcs
        • undiluted
        • diluted