Commit 32b2a62b authored by eric pellegrini's avatar eric pellegrini
Browse files

advances in gitlab-gitflow integration

parent 4283c53e
Pipeline #918 canceled with stages
in 1 minute and 19 seconds
......@@ -47,22 +47,18 @@ class TestPreferences(UnitTest):
def setUp(self):
PREFERENCES = Preferences()
def tearDown(self):
pass
self._preferences = Preferences()
def test_get_item(self):
self.assertRaises(PreferencesError,PREFERENCES.__getitem__,'xxxxx')
self.assertRaises(PreferencesError,self._preferences.__getitem__,'xxxxx')
def test_set_item(self):
val = PREFERENCES["working_directory"].get_value()
PREFERENCES["working_directory"].set_value("test")
self.assertEqual(PREFERENCES["working_directory"].value,os.path.join(os.getcwd(),"test"))
PREFERENCES["working_directory"].set_value(val)
val = self._preferences["working_directory"].get_value()
self._preferences["working_directory"].set_value("test")
self.assertEqual(self._preferences["working_directory"].value,os.path.join(os.getcwd(),"test"))
self._preferences["working_directory"].set_value(val)
shutil.rmtree("test")
......@@ -72,7 +68,7 @@ class TestPreferences(UnitTest):
'''
# Test that loading a preferences file whose type is not a basestring throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.load,10)
self.assertRaises(PreferencesError,self._preferences.load,10)
def test_save_preferences(self):
'''
......@@ -80,9 +76,9 @@ class TestPreferences(UnitTest):
'''
# Test that saving a preferences file whose type is not a basestring throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.save,10)
self.assertRaises(PreferencesError,self._preferences.save,10)
# Test that saving a preferences whose path does not exists throw a PreferencesError
self.assertRaises(PreferencesError,PREFERENCES.save,os.path.join('xxxx','yyyy'))
self.assertRaises(PreferencesError,self._preferences.save,os.path.join('xxxx','yyyy'))
def suite():
loader = unittest.TestLoader()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment