tests: Fix up the javascript and python tests
authorStef Walter <stefw@gnome.org>
Wed, 11 Dec 2013 09:12:23 +0000 (10:12 +0100)
committerStef Walter <stefw@gnome.org>
Wed, 11 Dec 2013 09:12:51 +0000 (10:12 +0100)
libsecret/tests/test-clear-password.js
libsecret/tests/test-clear-password.py
libsecret/tests/test-lookup-password.js
libsecret/tests/test-lookup-password.py
libsecret/tests/test-store-password.js
libsecret/tests/test-store-password.py

index f7e0169..357cb5c 100644 (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) {
index fde98b7..32276f6 100644 (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()
index 4c3d3b2..90cb158 100644 (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) {
index bde21a9..157b585 100644 (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()
index 0d9cb1b..13725c6 100644 (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) {
index 6d8a4bd..8b6f86b 100644 (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()