Beispiel #1
0
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'
Beispiel #2
0
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"
Beispiel #3
0
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"
Beispiel #4
0
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'
Beispiel #5
0
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'
Beispiel #6
0
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'