def test_get_ui_platform(self): uiclass, osx = get_ui_platform('windows') self.assertFalse(osx) self.assertEqual(uiclass.__name__, PwmanCliWinNew.__name__) uiclass, osx = get_ui_platform('darwin') self.assertTrue(osx) self.assertEqual(uiclass.__name__, PwmanCliMacNew.__name__) del(uiclass) del(osx)
node = NewNode() node.username = username node.password = password node.url = url node.notes = notes tags = [TagNew(tn) for tn in tags] node.tags = tags return node # TODO: fix hard coded db versions! 0.4 should be replaced with # from pwman.data.database import __DB_FORMAT__ _saveconfig = False PwmanCliNew, OSX = get_ui_platform(sys.platform) from test_tools import (SetupTester, DummyCallback2, DummyCallback3, DummyCallback4) class DBTests(unittest.TestCase): """test everything related to db""" def setUp(self): "test that the right db instance was created" dbver = __DB_FORMAT__ self.dbtype = config.get_value("Database", "type") self.db = factory.create(self.dbtype, dbver)