def test_axiomaticSubcommand(self): """ L{Upgrade} is available as a subcommand of I{axiomatic}. """ subCommands = axiomatic.Options().subCommands [options] = [cmd[2] for cmd in subCommands if cmd[0] == 'upgrade'] self.assertIdentical(options, Upgrade)
def test_parseOptions(self): """ L{Start.parseOptions} adds axiomatic-suitable defaults for any unspecified parameters and then calls L{twistd.run} with the modified argument list. """ argv = [] def fakeRun(): argv.extend(sys.argv) options = axiomatic.Options() options['dbdir'] = dbdir = self.mktemp() start = axiomatic.Start() start.parent = options start.run = fakeRun original = sys.argv[:] try: start.parseOptions(["-l", "foo", "--pidfile", "bar"]) finally: sys.argv[:] = original self.assertEqual(argv, [ sys.argv[0], "-l", "foo", "--pidfile", "bar", "axiomatic-start", "--dbdir", os.path.abspath(dbdir) ])
def test_journalMode(self): """ I{axiomatic} sets the journal mode of the store according to I{--journal-mode}. """ options = axiomatic.Options() options['dbdir'] = self.mktemp() options['journal-mode'] = 'WAL' self.assertEqual(options.getStore().journalMode, u'WAL')