File: fontfield.py

package info (click to toggle)
python-gpyconf 0.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 416 kB
  • ctags: 590
  • sloc: python: 1,980; makefile: 87; sh: 4
file content (29 lines) | stat: -rw-r--r-- 747 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Tests the gpyconf.fields.FontField, particularly saving.
import unittest
import gpyconf
import gpyconftest

class FontFieldTestConf(gpyconftest.Configuration):
    f = gpyconf.fields.FontField()

class FontFieldTestCase(unittest.TestCase):
    def setUp(self):
        self.conf = FontFieldTestConf()

    def runTest(self):
        value = self.conf.f
        self.conf.save()
        del self.conf
        self.setUp()
        self.assertEqual(value, self.conf.f)

        print "don't change the value!"
        self.conf.run_frontend()
        self.assertEqual(value, self.conf.f)

        print "now change it"
        self.conf.run_frontend()
        self.assertNotEqual(value, self.conf.f)

if __name__ == '__main__':
    unittest.main()