コード例 #1
0
ファイル: test-py-clear.py プロジェクト: val-verde/libsecret
 def tearDown(self):
     Secret.Service.disconnect()
     Mock.stop()
コード例 #2
0
	def tearDown(self):
		Mock.stop()
コード例 #3
0
ファイル: test-py-clear.py プロジェクト: val-verde/libsecret
 def setUp(self):
     Mock.start("mock-service-normal.py")
コード例 #4
0
	def setUp(self):
		Mock.start("mock-service-normal.py")
コード例 #5
0
#!/usr/bin/env python

import unittest

from gi.repository import MockService as Mock
from gi.repository import Secret, GLib

Mock.start("mock-service-normal.py")

STORE_SCHEMA = Secret.Schema.new("org.mock.Schema",
	Secret.SchemaFlags.NONE,
	{
		"number": Secret.SchemaAttributeType.INTEGER,
		"string": Secret.SchemaAttributeType.STRING,
		"even": Secret.SchemaAttributeType.BOOLEAN,
	}
)

class TestStore(unittest.TestCase):
	def setUp(self):
		Mock.start("mock-service-normal.py")

	def tearDown(self):
		Mock.stop()

	def testSynchronous(self):
		attributes = { "number": "9", "string": "nine", "even": "false" }

		password = Secret.password_lookup_sync(STORE_SCHEMA, attributes, None)
		self.assertEqual(None, password)
コード例 #6
0
 def tearDown(self):
     Mock.stop()
コード例 #7
0
#!/usr/bin/env python

import unittest

from gi.repository import MockService as Mock
from gi.repository import Secret, GLib

Mock.start("mock-service-normal.py")

STORE_SCHEMA = Secret.Schema.new(
    "org.mock.Schema", Secret.SchemaFlags.NONE, {
        "number": Secret.SchemaAttributeType.INTEGER,
        "string": Secret.SchemaAttributeType.STRING,
        "even": Secret.SchemaAttributeType.BOOLEAN,
    })


class TestLookup(unittest.TestCase):
    def setUp(self):
        Mock.start("mock-service-normal.py")

    def tearDown(self):
        Mock.stop()

    def testSynchronous(self):
        password = Secret.password_lookup_sync(STORE_SCHEMA, {
            "number": "1",
            "even": "false"
        }, None)
        self.assertEqual("111", password)
コード例 #8
0
ファイル: test-unstable.py プロジェクト: Arkhont/libsecret
	def tearDown(self):
		SecretUnstable.Service.disconnect()
		Mock.stop()