<s> import mock <EOL> from nailgun . assassin import assassind <EOL> from nailgun . test . base import BaseIntegrationTest <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> class TestKeepalive ( BaseIntegrationTest ) : <EOL> VERY_LONG_TIMEOUT = <NUM_LIT> * <NUM_LIT> <EOL> ZERO_TIMEOUT = <NUM_LIT:0> <EOL> def test_node_becomes_offline ( self , m_logger ) : <EOL> node = self . env . create_node ( <EOL> status = "<STR_LIT>" , <EOL> roles = [ "<STR_LIT>" ] , <EOL> name = "<STR_LIT>" <EOL> ) <EOL> assassind . update_nodes_status ( self . VERY_LONG_TIMEOUT , m_logger ) <EOL> self . assertEqual ( node . online , True ) <EOL> assassind . update_nodes_status ( self . ZERO_TIMEOUT , m_logger ) <EOL> self . assertEqual ( node . online , False ) <EOL> def test_provisioning_node_not_becomes_offline ( self , m_logger ) : <EOL> node = self . env . create_node ( <EOL> status = "<STR_LIT>" , <EOL> roles = [ "<STR_LIT>" ] , <EOL> name = "<STR_LIT>" <EOL> ) <EOL> assassind . update_nodes_status ( self . ZERO_TIMEOUT , m_logger ) <EOL> self . assertEqual ( node . online , True ) </s>
