| 1 |
|
| 2 |
import os, sys |
| 3 |
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__),"../..")) |
| 4 |
sys.path.insert(0, TOPDIR) |
| 5 |
|
| •6 |
import tools.unittests |
| 7 |
|
| 8 |
from random import randint, random |
| 9 |
from wxgeometrie.geolib import Texte |
| 10 |
|
| 11 |
def rand(): |
| 12 |
return randint(0,50) - randint(0,50) + random() |
| 13 |
|
| •14 |
class GeolibTest(tools.unittests.TestCase): |
| 15 |
def test_Texte(self): |
| 16 |
t = Texte("spam & eggs", rand(), rand()) |
| 17 |
self.assertEqual(t.texte, "spam & eggs") |
| 18 |
|
| 19 |
def test_style_temporaire(self): |
| 20 |
e |
| 21 |
que |
| 22 |
e |
| 23 |
de. |
| 24 |
t = Texte("blabla", nouveau_texte=True) |
| 25 |
del t._style['nouveau_texte'] |