# tests.test_set_pref

import nose.tools as nose
import yvs.set_pref as yvs


def test_set_language():
    """should set preferred language"""
    new_language = 'es'
    yvs.main('language:{}'.format(new_language))
    user_prefs = yvs.shared.get_user_prefs()
    nose.assert_equal(user_prefs['language'], new_language)
    bible = yvs.shared.get_bible_data(user_prefs['language'])
    nose.assert_equal(user_prefs['version'], bible['default_version'])


def test_set_version():
    """should set preferred version"""
    new_version = 59
    yvs.main('version:{}'.format(new_version))
    user_prefs = yvs.shared.get_user_prefs()
    nose.assert_equal(user_prefs['version'], new_version)

@@ -683,8 +683,289 @@
 ersion)%0A
+%0A%0Adef test_set_search_engine():%0A    %22%22%22should set preferred search engine%22%22%22%0A    new_search_engine = 'yahoo'%0A    yvs.main('searchEngine:%7B%7D'.format(new_search_engine))%0A    user_prefs = yvs.shared.get_user_prefs()%0A    nose.assert_equal(user_prefs%5B'searchEngine'%5D, new_search_engine)%0A

Add test for setting preferred search engine