#!/usr/bin/env python
import locale
import time

import coral
import coral ; metamodel=coral.lang.UML14

old1 = locale.setlocale(locale.LC_TIME, "")
print "OLD1 is", old1

s1 = time.strftime("%a, %d %b %Y %H:%M:%S %z", time.localtime())

m = metamodel.Model()

coral.saveModel("tmp/out_locale.xml", m)

s2 = time.strftime("%a, %d %b %Y %H:%M:%S %z", time.localtime())

old2 = locale.setlocale(locale.LC_TIME, "")
print "OLD2 is", old2

print "BEFORE", s1
print "AFTER", s2
# This will fail if you run it around midnight ;)
assert(s1[:20] == s2[:20])


