tests: Fix up the javascript and python tests

This commit is contained in:
Stef Walter 2013-12-11 10:12:23 +01:00
parent 37d1b73c25
commit d743d4dbcc
6 changed files with 14 additions and 13 deletions

View File

@ -20,7 +20,7 @@ const assertTrue = JsUnit.assertTrue;
Mock.start("mock-service-normal.py");
const STORE_SCHEMA = new Secret.Schema.new("org.mock.Schema",
const STORE_SCHEMA = new Secret.Schema("org.mock.Schema",
Secret.SchemaFlags.NONE,
{
"number": Secret.SchemaAttributeType.INTEGER,
@ -52,7 +52,7 @@ var attributes = { "number": "2", "string": "two", "even": "true" };
var password = Secret.password_lookup_sync (STORE_SCHEMA, attributes, null);
assertEquals("222", password);
var loop = new GLib.MainLoop.new(null, false);
var loop = new GLib.MainLoop(null, false);
Secret.password_clear (STORE_SCHEMA, attributes,
null, function(source, result) {

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
#
# Copyright 2012 Red Hat Inc.
#
@ -9,8 +11,7 @@
# See the included COPYING file for more information.
#
#!/usr/bin/env python
import sys
import unittest
from gi.repository import MockService as Mock
@ -52,7 +53,7 @@ class TestRemove(unittest.TestCase):
self.assertEqual(False, deleted)
def testAsynchronous(self):
loop = GLib.MainLoop(None, False)
loop = GLib.MainLoop(None)
def on_result_ready(source, result, unused):
loop.quit()
@ -65,7 +66,7 @@ class TestRemove(unittest.TestCase):
loop.run()
def testAsyncNotFound(self):
loop = GLib.MainLoop(None, False)
loop = GLib.MainLoop(None)
def on_result_ready(source, result, unused):
loop.quit()

View File

@ -20,7 +20,7 @@ const assertTrue = JsUnit.assertTrue;
Mock.start("mock-service-normal.py");
const STORE_SCHEMA = new Secret.Schema.new("org.mock.Schema",
const STORE_SCHEMA = new Secret.Schema("org.mock.Schema",
Secret.SchemaFlags.NONE,
{
"number": Secret.SchemaAttributeType.INTEGER,
@ -39,7 +39,7 @@ assertEquals(null, password);
/* Asynchronous */
var loop = new GLib.MainLoop.new(null, false);
var loop = new GLib.MainLoop(null, false);
Secret.password_lookup (STORE_SCHEMA, { "number": "2", "string": "two" },
null, function(source, result) {

View File

@ -42,7 +42,7 @@ class TestLookup(unittest.TestCase):
self.assertEqual(None, password)
def testAsynchronous(self):
loop = GLib.MainLoop(None, False)
loop = GLib.MainLoop(None)
def on_result_ready(source, result, unused):
loop.quit()
@ -55,7 +55,7 @@ class TestLookup(unittest.TestCase):
loop.run()
def testAsyncNotFound(self):
loop = GLib.MainLoop(None, False)
loop = GLib.MainLoop(None)
def on_result_ready(source, result, unused):
loop.quit()

View File

@ -20,7 +20,7 @@ const assertTrue = JsUnit.assertTrue;
Mock.start("mock-service-normal.py");
const STORE_SCHEMA = new Secret.Schema.new("org.mock.Schema",
const STORE_SCHEMA = new Secret.Schema("org.mock.Schema",
Secret.SchemaFlags.NONE,
{
"number": Secret.SchemaAttributeType.INTEGER,
@ -51,7 +51,7 @@ var attributes = { "number": "888", "string": "eight", "even": "true" };
var password = Secret.password_lookup_sync (STORE_SCHEMA, attributes, null);
assertEquals(null, password);
var loop = new GLib.MainLoop.new(null, false);
var loop = new GLib.MainLoop(null, false);
Secret.password_store (STORE_SCHEMA, attributes, null, "The number eight", "888",
null, function(source, result) {

View File

@ -52,7 +52,7 @@ class TestStore(unittest.TestCase):
password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
self.assertEqual(None, password);
loop = GLib.MainLoop(None, False)
loop = GLib.MainLoop(None)
def on_result_ready(source, result, unused):
loop.quit()