import pytest
from metrum.units import *


def test_distance ():
    assert m == pytest.approx(1)

    assert dm == pytest.approx(0.100) and dm.name == 'decimetre'
    assert cm == pytest.approx(0.010) and cm.name == 'centimetre'
    assert mm == pytest.approx(0.001) and mm.name == 'millimetre'
    assert um == pytest.approx(1e-6)  and um.name == 'micrometre'
    assert nm == pytest.approx(1e-9)  and nm.name == 'nanometre'
    assert pm == pytest.approx(1e-12) and pm.name == 'picometre'
    assert dam == pytest.approx(10)   and dam.name == 'decametre'
    assert hm == pytest.approx(100)   and hm.name == 'hettometre'
    assert km == pytest.approx(1000)  and km.name == 'kilometre'
    assert Mm == pytest.approx(1e+6)  and Mm.name == 'megametre'
    assert Gm == pytest.approx(1e+9)  and Gm.name == 'gigametre'
    assert Tm == pytest.approx(1e+12) and Tm.name == 'terametre'


def test_time():
    assert s == pytest.approx(1)      and s.name == 'second'
    assert ds == pytest.approx(0.1)   and ds.name == 'decisecond'
    assert cs == pytest.approx(0.01)  and cs.name == 'centisecond'
    assert ms == pytest.approx(0.001) and ms.name == 'millisecond'
    assert us == pytest.approx(1e-6)  and us.name == 'microsecond'
    assert ns == pytest.approx(1e-9)  and ns.name == 'nanosecond'
    assert ps == pytest.approx(1e-12) and ps.name == 'picosecond'
    assert das == pytest.approx(10)   and das.name == 'decasecond'
    assert hs == pytest.approx(100)   and hs.name == 'hettosecond'
    assert ks == pytest.approx(1000)  and ks.name == 'kilosecond'
    assert Ms == pytest.approx(1e6)   and Ms.name == 'megasecond'
    assert Gs == pytest.approx(1e9)   and Gs.name == 'gigasecond'
    assert Ts == pytest.approx(1e12)  and Ts.name == 'terasecond'


def test_mass():
    assert g == pytest.approx(0.001)  and g.name == 'gram'
    assert dg == pytest.approx(0.0001) and dg.name == 'decigram'
    assert cg == pytest.approx(0.00001) and cg.name == 'centigram'
    assert mg == pytest.approx(1e-6)  and mg.name == 'milligram'
    assert ug == pytest.approx(1e-9)  and ug.name == 'microgram'
    assert ng == pytest.approx(1e-12) and ng.name == 'nanogram'
    assert pg == pytest.approx(1e-15) and pg.name == 'picogram'
    assert dag == pytest.approx(0.01) and dag.name == 'decagram'
    assert hg == pytest.approx(0.1)   and hg.name == 'hettogram'
    assert kg == pytest.approx(1)     and kg.name == 'kilogram'
    assert Mg == pytest.approx(1000)  and Mg.name == 'megagram'
    assert Gg == pytest.approx(1e6)   and Gg.name == 'gigagram'
    assert Tg == pytest.approx(1e9)   and Tg.name == 'teragram'


def test_electric_current():
    assert A == pytest.approx(1)      and A.name == 'ampere'
    assert dA == pytest.approx(0.1)   and dA.name == 'deciampere'
    assert cA == pytest.approx(0.01)  and cA.name == 'centiampere'
    assert mA == pytest.approx(0.001) and mA.name == 'milliampere'
    assert uA == pytest.approx(1e-6)  and uA.name == 'microampere'
    assert nA == pytest.approx(1e-9)  and nA.name == 'nanoampere'
    assert pA == pytest.approx(1e-12) and pA.name == 'picoampere'
    assert daA == pytest.approx(10)   and daA.name == 'decaampere'
    assert hA == pytest.approx(100)   and hA.name == 'hettoampere'
    assert kA == pytest.approx(1000)  and kA.name == 'kiloampere'
    assert MA == pytest.approx(1e6)   and MA.name == 'megaampere'
    assert GA == pytest.approx(1e9)   and GA.name == 'gigaampere'
    assert TA == pytest.approx(1e12)  and TA.name == 'teraampere'


def test_thermodynamic_temperature():
    assert K == pytest.approx(1)      and K.name == 'kelvin'
    assert dK == pytest.approx(0.1)   and dK.name == 'decikelvin'
    assert cK == pytest.approx(0.01)  and cK.name == 'centikelvin'
    assert mK == pytest.approx(0.001) and mK.name == 'millikelvin'
    assert uK == pytest.approx(1e-6)  and uK.name == 'microkelvin'
    assert nK == pytest.approx(1e-9)  and nK.name == 'nanokelvin'
    assert pK == pytest.approx(1e-12) and pK.name == 'picokelvin'
    assert daK == pytest.approx(10)   and daK.name == 'decakelvin'
    assert hK == pytest.approx(100)   and hK.name == 'hettokelvin'
    assert kK == pytest.approx(1000)  and kK.name == 'kilokelvin'
    assert MK == pytest.approx(1e6)   and MK.name == 'megakelvin'
    assert GK == pytest.approx(1e9)   and GK.name == 'gigakelvin'
    assert TK == pytest.approx(1e12)  and TK.name == 'terakelvin'


def test_amount_of_substance():
    assert mol == pytest.approx(1)      and mol.name == 'mole'
    assert dmol == pytest.approx(0.1)   and dmol.name == 'decimole'
    assert cmol == pytest.approx(0.01)  and cmol.name == 'centimole'
    assert mmol == pytest.approx(0.001) and mmol.name == 'millimole'
    assert umol == pytest.approx(1e-6)  and umol.name == 'micromole'
    assert nmol == pytest.approx(1e-9)  and nmol.name == 'nanomole'
    assert pmol == pytest.approx(1e-12) and pmol.name == 'picomole'
    assert damol == pytest.approx(10)   and damol.name == 'decamole'
    assert hmol == pytest.approx(100)   and hmol.name == 'hettomole'
    assert kmol == pytest.approx(1000)  and kmol.name == 'kilomole'
    assert Mmol == pytest.approx(1e6)   and Mmol.name == 'megamole'
    assert Gmol == pytest.approx(1e9)   and Gmol.name == 'gigamole'
    assert Tmol == pytest.approx(1e12)  and Tmol.name == 'teramole'


def test_luminous_intensity():
    assert cd == pytest.approx(1)      and cd.name == 'candela'
    assert dcd == pytest.approx(0.1)   and dcd.name == 'decicandela'
    assert ccd == pytest.approx(0.01)  and ccd.name == 'centicandela'
    assert mcd == pytest.approx(0.001) and mcd.name == 'millicandela'
    assert ucd == pytest.approx(1e-6)  and ucd.name == 'microcandela'
    assert ncd == pytest.approx(1e-9)  and ncd.name == 'nanocandela'
    assert pcd == pytest.approx(1e-12) and pcd.name == 'picocandela'
    assert dacd == pytest.approx(10)   and dacd.name == 'decacandela'
    assert hcd == pytest.approx(100)   and hcd.name == 'hettocandela'
    assert kcd == pytest.approx(1000)  and kcd.name == 'kilocandela'
    assert Mcd == pytest.approx(1e6)   and Mcd.name == 'megacandela'
    assert Gcd == pytest.approx(1e9)   and Gcd.name == 'gigacandela'
    assert Tcd == pytest.approx(1e12)  and Tcd.name == 'teracandela'


def test_plane_angle():
    assert rad == pytest.approx(1)      and rad.name == 'radian'
    assert drad == pytest.approx(0.1)   and drad.name == 'deciradian'
    assert crad == pytest.approx(0.01)  and crad.name == 'centiradian'
    assert mrad == pytest.approx(0.001) and mrad.name == 'milliradian'
    assert urad == pytest.approx(1e-6)  and urad.name == 'microradian'
    assert nrad == pytest.approx(1e-9)  and nrad.name == 'nanoradian'
    assert prad == pytest.approx(1e-12) and prad.name == 'picoradian'
    assert darad == pytest.approx(10)   and darad.name == 'decaradian'
    assert hrad == pytest.approx(100)   and hrad.name == 'hettoradian'
    assert krad == pytest.approx(1000)  and krad.name == 'kiloradian'
    assert Mrad == pytest.approx(1e6)   and Mrad.name == 'megaradian'
    assert Grad == pytest.approx(1e9)   and Grad.name == 'gigaradian'
    assert Trad == pytest.approx(1e12)  and Trad.name == 'teraradian'


def test_solid_angle():
    assert sr == pytest.approx(1)      and sr.name == 'steradian'
    assert dsr == pytest.approx(0.1)   and dsr.name == 'decisteradian'
    assert csr == pytest.approx(0.01)  and csr.name == 'centisteradian'
    assert msr == pytest.approx(0.001) and msr.name == 'millisteradian'
    assert usr == pytest.approx(1e-6)  and usr.name == 'microsteradian'
    assert nsr == pytest.approx(1e-9)  and nsr.name == 'nanosteradian'
    assert psr == pytest.approx(1e-12) and psr.name == 'picosteradian'
    assert dasr == pytest.approx(10)   and dasr.name == 'decasteradian'
    assert hsr == pytest.approx(100)   and hsr.name == 'hettosteradian'
    assert ksr == pytest.approx(1000)  and ksr.name == 'kilosteradian'
    assert Msr == pytest.approx(1e6)   and Msr.name == 'megasteradian'
    assert Gsr == pytest.approx(1e9)   and Gsr.name == 'gigasteradian'
    assert Tsr == pytest.approx(1e12)  and Tsr.name == 'terasteradian'


def test_frequency():
    assert Hz == pytest.approx(1)      and Hz.name == 'hertz'
    assert dHz == pytest.approx(0.1)   and dHz.name == 'decihertz'
    assert cHz == pytest.approx(0.01)  and cHz.name == 'centihertz'
    assert mHz == pytest.approx(0.001) and mHz.name == 'millihertz'
    assert uHz == pytest.approx(1e-6)  and uHz.name == 'microhertz'
    assert nHz == pytest.approx(1e-9)  and nHz.name == 'nanohertz'
    assert pHz == pytest.approx(1e-12) and pHz.name == 'picohertz'
    assert daHz == pytest.approx(10)   and daHz.name == 'decahertz'
    assert hHz == pytest.approx(100)   and hHz.name == 'hettohertz'
    assert kHz == pytest.approx(1000)  and kHz.name == 'kilohertz'
    assert MHz == pytest.approx(1e6)   and MHz.name == 'megahertz'
    assert GHz == pytest.approx(1e9)   and GHz.name == 'gigahertz'
    assert THz == pytest.approx(1e12)  and THz.name == 'terahertz'


def test_force():
    assert N == pytest.approx(1)      and N.name == 'newton'
    assert dN == pytest.approx(0.1)   and dN.name == 'decinewton'
    assert cN == pytest.approx(0.01)  and cN.name == 'centinewton'
    assert mN == pytest.approx(0.001) and mN.name == 'millinewton'
    assert uN == pytest.approx(1e-6)  and uN.name == 'micronewton'
    assert nN == pytest.approx(1e-9)  and nN.name == 'nanonewton'
    assert pN == pytest.approx(1e-12) and pN.name == 'piconewton'
    assert daN == pytest.approx(10)   and daN.name == 'decanewton'
    assert hN == pytest.approx(100)   and hN.name == 'hettonewton'
    assert kN == pytest.approx(1000)  and kN.name == 'kilonewton'
    assert MN == pytest.approx(1e6)   and MN.name == 'meganewton'
    assert GN == pytest.approx(1e9)   and GN.name == 'giganewton'
    assert TN == pytest.approx(1e12)  and TN.name == 'teranewton'


def test_pressure():
    assert Pa == pytest.approx(1)      and Pa.name == 'pascal'
    assert dPa == pytest.approx(0.1)   and dPa.name == 'decipascal'
    assert cPa == pytest.approx(0.01)  and cPa.name == 'centipascal'
    assert mPa == pytest.approx(0.001) and mPa.name == 'millipascal'
    assert uPa == pytest.approx(1e-6)  and uPa.name == 'micropascal'
    assert nPa == pytest.approx(1e-9)  and nPa.name == 'nanopascal'
    assert pPa == pytest.approx(1e-12) and pPa.name == 'picopascal'
    assert daPa == pytest.approx(10)   and daPa.name == 'decapascal'
    assert hPa == pytest.approx(100)   and hPa.name == 'hettopascal'
    assert kPa == pytest.approx(1000)  and kPa.name == 'kilopascal'
    assert MPa == pytest.approx(1e6)   and MPa.name == 'megapascal'
    assert GPa == pytest.approx(1e9)   and GPa.name == 'gigapascal'
    assert TPa == pytest.approx(1e12)  and TPa.name == 'terapascal'


def test_energy():
    assert J == pytest.approx(1)      and J.name == 'joule'
    assert dJ == pytest.approx(0.1)   and dJ.name == 'decijoule'
    assert cJ == pytest.approx(0.01)  and cJ.name == 'centijoule'
    assert mJ == pytest.approx(0.001) and mJ.name == 'millijoule'
    assert uJ == pytest.approx(1e-6)  and uJ.name == 'microjoule'
    assert nJ == pytest.approx(1e-9)  and nJ.name == 'nanojoule'
    assert pJ == pytest.approx(1e-12) and pJ.name == 'picojoule'
    assert daJ == pytest.approx(10)   and daJ.name == 'decajoule'
    assert hJ == pytest.approx(100)   and hJ.name == 'hettojoule'
    assert kJ == pytest.approx(1000)  and kJ.name == 'kilojoule'
    assert MJ == pytest.approx(1e6)   and MJ.name == 'megajoule'
    assert GJ == pytest.approx(1e9)   and GJ.name == 'gigajoule'
    assert TJ == pytest.approx(1e12)  and TJ.name == 'terajoule'


def test_power():
    assert W == pytest.approx(1)      and W.name == 'watt'
    assert dW == pytest.approx(0.1)   and dW.name == 'deciwatt'
    assert cW == pytest.approx(0.01)  and cW.name == 'centiwatt'
    assert mW == pytest.approx(0.001) and mW.name == 'milliwatt'
    assert uW == pytest.approx(1e-6)  and uW.name == 'microwatt'
    assert nW == pytest.approx(1e-9)  and nW.name == 'nanowatt'
    assert pW == pytest.approx(1e-12) and pW.name == 'picowatt'
    assert daW == pytest.approx(10)   and daW.name == 'decawatt'
    assert hW == pytest.approx(100)   and hW.name == 'hettowatt'
    assert kW == pytest.approx(1000)  and kW.name == 'kilowatt'
    assert MW == pytest.approx(1e6)   and MW.name == 'megawatt'
    assert GW == pytest.approx(1e9)   and GW.name == 'gigawatt'
    assert TW == pytest.approx(1e12)  and TW.name == 'terawatt'


def test_electric_charge():
    assert C == pytest.approx(1)      and C.name == 'coulomb'
    assert dC == pytest.approx(0.1)   and dC.name == 'decicoulomb'
    assert cC == pytest.approx(0.01)  and cC.name == 'centicoulomb'
    assert mC == pytest.approx(0.001) and mC.name == 'millicoulomb'
    assert uC == pytest.approx(1e-6)  and uC.name == 'microcoulomb'
    assert nC == pytest.approx(1e-9)  and nC.name == 'nanocoulomb'
    assert pC == pytest.approx(1e-12) and pC.name == 'picocoulomb'
    assert daC == pytest.approx(10)   and daC.name == 'decacoulomb'
    assert hC == pytest.approx(100)   and hC.name == 'hettocoulomb'
    assert kC == pytest.approx(1000)  and kC.name == 'kilocoulomb'
    assert MC == pytest.approx(1e6)   and MC.name == 'megacoulomb'
    assert GC == pytest.approx(1e9)   and GC.name == 'gigacoulomb'
    assert TC == pytest.approx(1e12)  and TC.name == 'teracoulomb'


def test_electric_potential_difference():
    assert V == pytest.approx(1)      and V.name == 'volt'
    assert dV == pytest.approx(0.1)   and dV.name == 'decivolt'
    assert cV == pytest.approx(0.01)  and cV.name == 'centivolt'
    assert mV == pytest.approx(0.001) and mV.name == 'millivolt'
    assert uV == pytest.approx(1e-6)  and uV.name == 'microvolt'
    assert nV == pytest.approx(1e-9)  and nV.name == 'nanovolt'
    assert pV == pytest.approx(1e-12) and pV.name == 'picovolt'
    assert daV == pytest.approx(10)   and daV.name == 'decavolt'
    assert hV == pytest.approx(100)   and hV.name == 'hettovolt'
    assert kV == pytest.approx(1000)  and kV.name == 'kilovolt'
    assert MV == pytest.approx(1e6)   and MV.name == 'megavolt'
    assert GV == pytest.approx(1e9)   and GV.name == 'gigavolt'
    assert TV == pytest.approx(1e12)  and TV.name == 'teravolt'


def test_capacitance():
    assert F == pytest.approx(1)      and F.name == 'farad'
    assert dF == pytest.approx(0.1)   and dF.name == 'decifarad'
    assert cF == pytest.approx(0.01)  and cF.name == 'centifarad'
    assert mF == pytest.approx(0.001) and mF.name == 'millifarad'
    assert uF == pytest.approx(1e-6)  and uF.name == 'microfarad'
    assert nF == pytest.approx(1e-9)  and nF.name == 'nanofarad'
    assert pF == pytest.approx(1e-12) and pF.name == 'picofarad'
    assert daF == pytest.approx(10)   and daF.name == 'decafarad'
    assert hF == pytest.approx(100)   and hF.name == 'hettofarad'
    assert kF == pytest.approx(1000)  and kF.name == 'kilofarad'
    assert MF == pytest.approx(1e6)   and MF.name == 'megafarad'
    assert GF == pytest.approx(1e9)   and GF.name == 'gigafarad'
    assert TF == pytest.approx(1e12)  and TF.name == 'terafarad'


def test_electric_resistance():
    assert ohm == pytest.approx(1)      and ohm.name == 'ohm'
    assert dohm == pytest.approx(0.1)   and dohm.name == 'deciohm'
    assert cohm == pytest.approx(0.01)  and cohm.name == 'centiohm'
    assert mohm == pytest.approx(0.001) and mohm.name == 'milliohm'
    assert uohm == pytest.approx(1e-6)  and uohm.name == 'microohm'
    assert nohm == pytest.approx(1e-9)  and nohm.name == 'nanoohm'
    assert pohm == pytest.approx(1e-12) and pohm.name == 'picoohm'
    assert daohm == pytest.approx(10)   and daohm.name == 'decaohm'
    assert hohm == pytest.approx(100)   and hohm.name == 'hettoohm'
    assert kohm == pytest.approx(1000)  and kohm.name == 'kiloohm'
    assert Mohm == pytest.approx(1e6)   and Mohm.name == 'megaohm'
    assert Gohm == pytest.approx(1e9)   and Gohm.name == 'gigaohm'
    assert Tohm == pytest.approx(1e12)  and Tohm.name == 'teraohm'


def test_electric_conductance():
    assert S == pytest.approx(1)      and S.name == 'siemens'
    assert dS == pytest.approx(0.1)   and dS.name == 'decisiemens'
    assert cS == pytest.approx(0.01)  and cS.name == 'centisiemens'
    assert mS == pytest.approx(0.001) and mS.name == 'millisiemens'
    assert uS == pytest.approx(1e-6)  and uS.name == 'microsiemens'
    assert nS == pytest.approx(1e-9)  and nS.name == 'nanosiemens'
    assert pS == pytest.approx(1e-12) and pS.name == 'picosiemens'
    assert daS == pytest.approx(10)   and daS.name == 'decasiemens'
    assert hS == pytest.approx(100)   and hS.name == 'hettosiemens'
    assert kS == pytest.approx(1000)  and kS.name == 'kilosiemens'
    assert MS == pytest.approx(1e6)   and MS.name == 'megasiemens'
    assert GS == pytest.approx(1e9)   and GS.name == 'gigasiemens'
    assert TS == pytest.approx(1e12)  and TS.name == 'terasiemens'


def test_magnetic_flux():
    assert Wb == pytest.approx(1)      and Wb.name == 'weber'
    assert dWb == pytest.approx(0.1)   and dWb.name == 'deciweber'
    assert cWb == pytest.approx(0.01)  and cWb.name == 'centiweber'
    assert mWb == pytest.approx(0.001) and mWb.name == 'milliweber'
    assert uWb == pytest.approx(1e-6)  and uWb.name == 'microweber'
    assert nWb == pytest.approx(1e-9)  and nWb.name == 'nanoweber'
    assert pWb == pytest.approx(1e-12) and pWb.name == 'picoweber'
    assert daWb == pytest.approx(10)   and daWb.name == 'decaweber'
    assert hWb == pytest.approx(100)   and hWb.name == 'hettoweber'
    assert kWb == pytest.approx(1000)  and kWb.name == 'kiloweber'
    assert MWb == pytest.approx(1e6)   and MWb.name == 'megaweber'
    assert GWb == pytest.approx(1e9)   and GWb.name == 'gigaweber'
    assert TWb == pytest.approx(1e12)  and TWb.name == 'teraweber'


def test_magnetic_flux_density():
    assert T == pytest.approx(1)      and T.name == 'tesla'
    assert dT == pytest.approx(0.1)   and dT.name == 'decitesla'
    assert cT == pytest.approx(0.01)  and cT.name == 'centitesla'
    assert mT == pytest.approx(0.001) and mT.name == 'millitesla'
    assert uT == pytest.approx(1e-6)  and uT.name == 'microtesla'
    assert nT == pytest.approx(1e-9)  and nT.name == 'nanotesla'
    assert pT == pytest.approx(1e-12) and pT.name == 'picotesla'
    assert daT == pytest.approx(10)   and daT.name == 'decatesla'
    assert hT == pytest.approx(100)   and hT.name == 'hettotesla'
    assert kT == pytest.approx(1000)  and kT.name == 'kilotesla'
    assert MT == pytest.approx(1e6)   and MT.name == 'megatesla'
    assert GT == pytest.approx(1e9)   and GT.name == 'gigatesla'
    assert TT == pytest.approx(1e12)  and TT.name == 'teratesla'


def test_inductance():
    assert H == pytest.approx(1)      and H.name == 'henry'
    assert dH == pytest.approx(0.1)   and dH.name == 'decihenry'
    assert cH == pytest.approx(0.01)  and cH.name == 'centihenry'
    assert mH == pytest.approx(0.001) and mH.name == 'millihenry'
    assert uH == pytest.approx(1e-6)  and uH.name == 'microhenry'
    assert nH == pytest.approx(1e-9)  and nH.name == 'nanohenry'
    assert pH == pytest.approx(1e-12) and pH.name == 'picohenry'
    assert daH == pytest.approx(10)   and daH.name == 'decahenry'
    assert hH == pytest.approx(100)   and hH.name == 'hettohenry'
    assert kH == pytest.approx(1000)  and kH.name == 'kilohenry'
    assert MH == pytest.approx(1e6)   and MH.name == 'megahenry'
    assert GH == pytest.approx(1e9)   and GH.name == 'gigahenry'
    assert TH == pytest.approx(1e12)  and TH.name == 'terahenry'


def test_luminous_flux():
    assert lm == pytest.approx(1)      and lm.name == 'lumen'
    assert dlm == pytest.approx(0.1)   and dlm.name == 'decilumen'
    assert clm == pytest.approx(0.01)  and clm.name == 'centilumen'
    assert mlm == pytest.approx(0.001) and mlm.name == 'millilumen'
    assert ulm == pytest.approx(1e-6)  and ulm.name == 'microlumen'
    assert nlm == pytest.approx(1e-9)  and nlm.name == 'nanolumen'
    assert plm == pytest.approx(1e-12) and plm.name == 'picolumen'
    assert dalm == pytest.approx(10)   and dalm.name == 'decalumen'
    assert hlm == pytest.approx(100)   and hlm.name == 'hettolumen'
    assert klm == pytest.approx(1000)  and klm.name == 'kilolumen'
    assert Mlm == pytest.approx(1e6)   and Mlm.name == 'megalumen'
    assert Glm == pytest.approx(1e9)   and Glm.name == 'gigalumen'
    assert Tlm == pytest.approx(1e12)  and Tlm.name == 'teralumen'


def test_illuminance():
    assert lx == pytest.approx(1)      and lx.name == 'lux'
    assert dlx == pytest.approx(0.1)   and dlx.name == 'decilux'
    assert clx == pytest.approx(0.01)  and clx.name == 'centilux'
    assert mlx == pytest.approx(0.001) and mlx.name == 'millilux'
    assert ulx == pytest.approx(1e-6)  and ulx.name == 'microlux'
    assert nlx == pytest.approx(1e-9)  and nlx.name == 'nanolux'
    assert plx == pytest.approx(1e-12) and plx.name == 'picolux'
    assert dalx == pytest.approx(10)   and dalx.name == 'decalux'
    assert hlx == pytest.approx(100)   and hlx.name == 'hettolux'
    assert klx == pytest.approx(1000)  and klx.name == 'kilolux'
    assert Mlx == pytest.approx(1e6)   and Mlx.name == 'megalux'
    assert Glx == pytest.approx(1e9)   and Glx.name == 'gigalux'
    assert Tlx == pytest.approx(1e12)  and Tlx.name == 'teralux'


def test_activity():
    assert Bq == pytest.approx(1)      and Bq.name == 'bacquerel'
    assert dBq == pytest.approx(0.1)   and dBq.name == 'decibacquerel'
    assert cBq == pytest.approx(0.01)  and cBq.name == 'centibacquerel'
    assert mBq == pytest.approx(0.001) and mBq.name == 'millibacquerel'
    assert uBq == pytest.approx(1e-6)  and uBq.name == 'microbacquerel'
    assert nBq == pytest.approx(1e-9)  and nBq.name == 'nanobacquerel'
    assert pBq == pytest.approx(1e-12) and pBq.name == 'picobacquerel'
    assert daBq == pytest.approx(10)   and daBq.name == 'decabacquerel'
    assert hBq == pytest.approx(100)   and hBq.name == 'hettobacquerel'
    assert kBq == pytest.approx(1000)  and kBq.name == 'kilobacquerel'
    assert MBq == pytest.approx(1e6)   and MBq.name == 'megabacquerel'
    assert GBq == pytest.approx(1e9)   and GBq.name == 'gigabacquerel'
    assert TBq == pytest.approx(1e12)  and TBq.name == 'terabacquerel'


def test_absorbed_dose():
    assert Gy == pytest.approx(1)      and Gy.name == 'gray'
    assert dGy == pytest.approx(0.1)   and dGy.name == 'decigray'
    assert cGy == pytest.approx(0.01)  and cGy.name == 'centigray'
    assert mGy == pytest.approx(0.001) and mGy.name == 'milligray'
    assert uGy == pytest.approx(1e-6)  and uGy.name == 'microgray'
    assert nGy == pytest.approx(1e-9)  and nGy.name == 'nanogray'
    assert pGy == pytest.approx(1e-12) and pGy.name == 'picogray'
    assert daGy == pytest.approx(10)   and daGy.name == 'decagray'
    assert hGy == pytest.approx(100)   and hGy.name == 'hettogray'
    assert kGy == pytest.approx(1000)  and kGy.name == 'kilogray'
    assert MGy == pytest.approx(1e6)   and MGy.name == 'megagray'
    assert GGy == pytest.approx(1e9)   and GGy.name == 'gigagray'
    assert TGy == pytest.approx(1e12)  and TGy.name == 'teragray'


def test_dose_equivalent():
    assert Sv == pytest.approx(1)      and Sv.name == 'sievert'
    assert dSv == pytest.approx(0.1)   and dSv.name == 'decisievert'
    assert cSv == pytest.approx(0.01)  and cSv.name == 'centisievert'
    assert mSv == pytest.approx(0.001) and mSv.name == 'millisievert'
    assert uSv == pytest.approx(1e-6)  and uSv.name == 'microsievert'
    assert nSv == pytest.approx(1e-9)  and nSv.name == 'nanosievert'
    assert pSv == pytest.approx(1e-12) and pSv.name == 'picosievert'
    assert daSv == pytest.approx(10)   and daSv.name == 'decasievert'
    assert hSv == pytest.approx(100)   and hSv.name == 'hettosievert'
    assert kSv == pytest.approx(1000)  and kSv.name == 'kilosievert'
    assert MSv == pytest.approx(1e6)   and MSv.name == 'megasievert'
    assert GSv == pytest.approx(1e9)   and GSv.name == 'gigasievert'
    assert TSv == pytest.approx(1e12)  and TSv.name == 'terasievert'


def test_catalytic_activity():
    assert kat == pytest.approx(1)      and kat.name == 'katal'
    assert dkat == pytest.approx(0.1)   and dkat.name == 'decikatal'
    assert ckat == pytest.approx(0.01)  and ckat.name == 'centikatal'
    assert mkat == pytest.approx(0.001) and mkat.name == 'millikatal'
    assert ukat == pytest.approx(1e-6)  and ukat.name == 'microkatal'
    assert nkat == pytest.approx(1e-9)  and nkat.name == 'nanokatal'
    assert pkat == pytest.approx(1e-12) and pkat.name == 'picokatal'
    assert dakat == pytest.approx(10)   and dakat.name == 'decakatal'
    assert hkat == pytest.approx(100)   and hkat.name == 'hettokatal'
    assert kkat == pytest.approx(1000)  and kkat.name == 'kilokatal'
    assert Mkat == pytest.approx(1e6)   and Mkat.name == 'megakatal'
    assert Gkat == pytest.approx(1e9)   and Gkat.name == 'gigakatal'
    assert Tkat == pytest.approx(1e12)  and Tkat.name == 'terakatal'
