<s> import unittest <EOL> import mock <EOL> import segments . uptime as uptime <EOL> test_cases = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> } <EOL> class UptimeTest ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . powerline = mock . MagicMock ( ) <EOL> uptime . Color = mock . MagicMock ( ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_all ( self , check_output ) : <EOL> for stdout , result in test_cases . items ( ) : <EOL> check_output . return_value = stdout <EOL> uptime . add_uptime_segment ( self . powerline ) <EOL> self . assertEqual ( self . powerline . append . call_args [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] . split ( ) [ <NUM_LIT:0> ] , result ) </s>
