def test_e_sta_unknown(str_e_sta_unknown): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_unknown.split('\n')))) assert tools.e_sta() == 'Unknown'
def test_e_sta_rysnc_completed(str_e_sta_sync_completed): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_sync_completed.split('\n')))) assert tools.e_sta() == "Synced"
def test_e_sta_starting_rysnc(str_e_sta_starting_rsync): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_starting_rsync.split('\n')))) assert tools.e_sta() == "Syncing"
def test_e_sta_finished(str_e_sta_finished): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_finished.split('\n')))) assert tools.e_sta() == 'Finished'
def test_e_sta_completed_emerge(str_e_sta_completed_emerge): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_completed_emerge.split('\n')))) assert tools.e_sta() == 'Completed'
def test_e_sta_cleaning(str_e_sta_cleaning): with mock.patch('pyerge.tools.open') as open_mock: open_mock.return_value.__enter__ = open_mock open_mock.return_value.__iter__ = Mock( return_value=iter(list(str_e_sta_cleaning.split('\n')))) assert tools.e_sta() == 'Cleaning'