File tree Expand file tree Collapse file tree 1 file changed +34
-14
lines changed Expand file tree Collapse file tree 1 file changed +34
-14
lines changed Original file line number Diff line number Diff line change 1010import pytest
1111#import numpy as np
1212import PyPartMC as ppmc
13+ from .test_gas_data import GAS_DATA_CTOR_ARG_MINIMAL
1314
1415class TestGasState :
1516 @staticmethod
@@ -52,15 +53,13 @@ def test_ctor_valid():
5253 @staticmethod
5354 def test_len_empty ():
5455 # arrange
55- pass
56- #sut = ppmc.GasState()
56+ sut = ppmc .GasState ()
5757
5858 # act
59- # size = len(sut)
59+ size = len (sut )
6060
6161 # assert
62- #assert isinstance(size, int)
63- #assert size == 0 # TODO #123: test non-empty len
62+ assert size == 0
6463
6564 @staticmethod
6665 @pytest .mark .parametrize ("idx" , (- 1 , 100 ))
@@ -116,16 +115,37 @@ def test_set_item():
116115 # assert
117116 # assert sut[idx] == value TODO #123
118117
119- @staticmethod
120- def test_to_json ():
121- # arrange
122- data_in = {} # TODO #123
123- sut = ppmc .GasState (data_in )
124-
125- # act
126- data_out = str (sut )
127- print (data_out )
118+ # @staticmethod
119+ # def test_to_json():
120+ # # arrange
121+ # data_in = {} # TODO #123
122+ # sut = ppmc.GasState(data_in)
123+ #
124+ # # act
125+ # data_out = str(sut)
126+ # print(data_out)
128127
129128 # assert
130129 #assert data_in == data_out TODO #123
131130
131+ @staticmethod
132+ def test_set_gas_state_size ():
133+
134+ gas_data = ppmc .GasData (GAS_DATA_CTOR_ARG_MINIMAL )
135+
136+ sut = ppmc .GasState ()
137+
138+ sut .set_size (gas_data )
139+
140+ assert sut .__len__ () == len (gas_data )
141+
142+ @staticmethod
143+ def test_get_mix_rats ():
144+
145+ gas_data = ppmc .GasData (GAS_DATA_CTOR_ARG_MINIMAL )
146+
147+ sut = ppmc .GasState ()
148+
149+ sut .set_size (gas_data )
150+
151+ assert len (sut .mix_rats ) == len (gas_data )
You can’t perform that action at this time.
0 commit comments