mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 20:58:52 +00:00
tests: Fix up the javascript and python tests
This commit is contained in:
parent
37d1b73c25
commit
d743d4dbcc
@ -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) {
|
||||
|
@ -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()
|
||||
|
@ -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) {
|
||||
|
@ -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()
|
||||
|
@ -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) {
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user