summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-14 17:37:40 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-09-14 17:49:57 +0100
commit0bf6ed698102011576327856e16161cd19e1034d (patch)
tree7802a86ea8cf8f61cee9865f32f449b70c0a044a
parenta478b211eab9224f84a471bfbc1cf80d8ad2f094 (diff)
downloadtelepathy-mission-control-0bf6ed698102011576327856e16161cd19e1034d.tar.gz
Move keyfile_read() to mctest, fixing distcheck in a simple way
There seems little point in separating out such a small utility function.
-rw-r--r--test/twisted/account-storage/default-keyring-storage.py4
-rw-r--r--test/twisted/account-storage/diverted-storage.py4
-rw-r--r--test/twisted/account-storage/keyfile.py24
-rw-r--r--test/twisted/mctest.py23
4 files changed, 25 insertions, 30 deletions
diff --git a/test/twisted/account-storage/default-keyring-storage.py b/test/twisted/account-storage/default-keyring-storage.py
index e4059e9a..5d066d6a 100644
--- a/test/twisted/account-storage/default-keyring-storage.py
+++ b/test/twisted/account-storage/default-keyring-storage.py
@@ -27,11 +27,9 @@ import dbus.service
from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
call_async
from mctest import exec_test, create_fakecm_account, get_account_manager, \
- get_fakecm_account, make_mc, connect_to_mc
+ get_fakecm_account, make_mc, connect_to_mc, keyfile_read
import constants as cs
-from keyfile import keyfile_read
-
use_keyring = False
if ('MC_TEST_GNOME_KEYRING' in os.environ and
os.environ['MC_TEST_GNOME_KEYRING'] == '1'):
diff --git a/test/twisted/account-storage/diverted-storage.py b/test/twisted/account-storage/diverted-storage.py
index 283edc14..46b66b1b 100644
--- a/test/twisted/account-storage/diverted-storage.py
+++ b/test/twisted/account-storage/diverted-storage.py
@@ -27,11 +27,9 @@ import dbus.service
from servicetest import EventPattern, tp_name_prefix, tp_path_prefix, \
call_async
from mctest import exec_test, create_fakecm_account, get_account_manager, \
- get_fakecm_account, make_mc, connect_to_mc
+ get_fakecm_account, make_mc, connect_to_mc, keyfile_read
import constants as cs
-from keyfile import keyfile_read
-
def test(q, bus, mc):
empty_key_file_name = os.path.join(os.environ['MC_ACCOUNT_DIR'], 'accounts.cfg')
diff --git a/test/twisted/account-storage/keyfile.py b/test/twisted/account-storage/keyfile.py
deleted file mode 100644
index c1caf2e5..00000000
--- a/test/twisted/account-storage/keyfile.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-
-def keyfile_read(fname):
- groups = { None: {} }
- group = None
- for line in open(fname):
- line = line[:-1].decode('utf-8').strip()
- if not line or line.startswith('#'):
- continue
-
- if line.startswith('[') and line.endswith(']'):
- group = line[1:-1]
- groups[group] = {}
- continue
-
- if '=' in line:
- k, v = line.split('=', 1)
- else:
- k = line
- v = None
-
- groups[group][k] = v
- return groups
-
diff --git a/test/twisted/mctest.py b/test/twisted/mctest.py
index b5bc48a1..4cf45956 100644
--- a/test/twisted/mctest.py
+++ b/test/twisted/mctest.py
@@ -971,3 +971,26 @@ def connect_to_mc(q, bus, mc):
assert cs.AM_IFACE_NOKIA_QUERY in interfaces, interfaces
return account_manager, properties, interfaces
+
+def keyfile_read(fname):
+ groups = { None: {} }
+ group = None
+ for line in open(fname):
+ line = line[:-1].decode('utf-8').strip()
+ if not line or line.startswith('#'):
+ continue
+
+ if line.startswith('[') and line.endswith(']'):
+ group = line[1:-1]
+ groups[group] = {}
+ continue
+
+ if '=' in line:
+ k, v = line.split('=', 1)
+ else:
+ k = line
+ v = None
+
+ groups[group][k] = v
+ return groups
+