<s> import pytest <EOL> import OpenPNM <EOL> class GenericPhaseTest : <EOL> def setup_class ( self ) : <EOL> self . net = OpenPNM . Network . Cubic ( shape = [ <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:5> ] ) <EOL> def test_init_w_no_network ( self ) : <EOL> OpenPNM . Phases . GenericPhase ( ) <EOL> def test_init_w_components ( self ) : <EOL> comp1 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> comp2 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> OpenPNM . Phases . GenericPhase ( network = self . net , <EOL> components = [ comp1 , comp2 ] ) <EOL> def test_set_component_add ( self ) : <EOL> comp1 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> comp2 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase . set_component ( comp1 ) <EOL> phase . set_component ( comp2 ) <EOL> def test_set_component_add_twice ( self ) : <EOL> comp1 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase . set_component ( comp1 ) <EOL> with pytest . raises ( Exception ) : <EOL> phase . set_components ( comp1 ) <EOL> def test_set_component_remove ( self ) : <EOL> comp1 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> comp2 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase = OpenPNM . Phases . GenericPhase ( network = self . net , <EOL> components = [ comp1 , comp2 ] ) <EOL> phase . set_component ( comp1 , mode = '<STR_LIT>' ) <EOL> phase . set_component ( comp2 , mode = '<STR_LIT>' ) <EOL> def test_set_component_remove_twice ( self ) : <EOL> comp1 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> comp2 = OpenPNM . Phases . GenericPhase ( network = self . net ) <EOL> phase = OpenPNM . Phases . GenericPhase ( network = self . net , <EOL> components = [ comp1 , comp2 ] ) <EOL> phase . set_component ( comp1 , mode = '<STR_LIT>' ) <EOL> with pytest . raises ( Exception ) : <EOL> phase . set_component ( comp1 , mode = '<STR_LIT>' ) </s>
