예제 #1
0
    def test_basic_io(self):
        '''UserPreferences: create prefs, write them, read them'''
        mid = "ThisIsMyNotSoAutomatedGeneratedId"
        tdir = tempfile.mkdtemp()

        up = UserPreferences(tdir)
        up.set_value("stats", "id", mid)
        up.write()

        upr = UserPreferences(tdir)
        upr.read()
        val = upr.get_value("stats", "id")

        shutil.rmtree(tdir)

        self.assertEqual(mid, val)
예제 #2
0
    def test_basic_io(self):
        '''UserPreferences: create prefs, write them, read them'''
        mid = "ThisIsMyNotSoAutomatedGeneratedId"
        tdir = tempfile.mkdtemp()

        up = UserPreferences(tdir)
        up.set_value("stats", "id", mid)
        up.write()
        
        upr = UserPreferences(tdir)
        upr.read()
        val = upr.get_value("stats", "id")
        
        shutil.rmtree(tdir)
        
        self.assertEqual(mid, val)
        
예제 #3
0
 def test_add_new_value(self):
     '''UserPreferences: add new value to preferences.'''
     mid = "ThisIsMyNotSoAutomatedGeneratedId"
     up = UserPreferences()
     up.set_value("stats", "id", mid)
     self.assertEqual(mid, up.get_value("stats", "id"))
예제 #4
0
 def test_add_new_value(self):
     '''UserPreferences: add new value to preferences.'''
     mid = "ThisIsMyNotSoAutomatedGeneratedId"
     up = UserPreferences()
     up.set_value("stats", "id", mid)
     self.assertEqual(mid, up.get_value("stats", "id"))