summaryrefslogtreecommitdiff
path: root/tests/twisted/account-manager/avatar-persist.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/twisted/account-manager/avatar-persist.py')
-rw-r--r--tests/twisted/account-manager/avatar-persist.py41
1 files changed, 22 insertions, 19 deletions
diff --git a/tests/twisted/account-manager/avatar-persist.py b/tests/twisted/account-manager/avatar-persist.py
index 06ad65d8..e3496335 100644
--- a/tests/twisted/account-manager/avatar-persist.py
+++ b/tests/twisted/account-manager/avatar-persist.py
@@ -40,25 +40,28 @@ def preseed():
accounts_dir = os.environ['MC_ACCOUNT_DIR']
- accounts_cfg = open(accounts_dir + '/accounts.cfg', 'w')
- accounts_cfg.write("""# Telepathy accounts
-[%s]
-manager=fakecm
-protocol=fakeprotocol
-DisplayName=Work account
-NormalizedName=jc.denton@unatco.int
-param-account=jc.denton@unatco.int
-param-password=ionstorm
-Enabled=1
-ConnectAutomatically=1
-AutomaticPresenceType=2
-AutomaticPresenceStatus=available
-AutomaticPresenceMessage=My vision is augmented
-Nickname=JC
-AvatarMime=image/jpeg
-avatar_token=Deus Ex
-""" % account_id)
- accounts_cfg.close()
+ escaped = account_id.replace('/', '_')
+ filename = accounts_dir + '/' + escaped
+ account = open(filename, 'w')
+
+ account.write("""{
+'id': <'%s'>,
+'manager': <'fakecm'>,
+'protocol': <'fakeprotocol'>,
+'DisplayName': <'Work account'>,
+'NormalizedName': <'jc.denton@unatco.int'>,
+'param-account': <'jc.denton@unatco.int'>,
+'param-password': <'ionstorm'>,
+'Enabled': <true>,
+'ConnectAutomatically': <true>,
+'AutomaticPresenceType': <2>,
+'AutomaticPresenceStatus': <'available'>,
+'AutomaticPresenceMessage': <'My vision is augmented'>,
+'Nickname': <'JC'>,
+'AvatarMime': <'image/jpeg'>,
+'avatar_token': <'Deus Ex'>
+}""" % account_id)
+ account.close()
os.makedirs(accounts_dir + '/' + account_id)
avatar_bin = open(accounts_dir + '/' + account_id + '/avatar.bin', 'w')