本文整理汇总了Python中simple_db_migrate.cli.CLI.parse方法的典型用法代码示例。如果您正苦于以下问题:Python CLI.parse方法的具体用法?Python CLI.parse怎么用?Python CLI.parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simple_db_migrate.cli.CLI
的用法示例。
在下文中一共展示了CLI.parse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_it_should_exit_with_help_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_exit_with_help_options(self, stdout_mock):
try:
CLI.parse(["-h"])
except SystemExit as e:
self.assertEqual(0, e.code)
self.assertTrue(stdout_mock.getvalue().find("Displays simple-db-migrate's version and exit") > 0)
stdout_mock.buf = ''
try:
CLI.parse(["--help"])
except SystemExit as e:
self.assertEqual(0, e.code)
示例2: test_it_should_accept_environment_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_environment_options(self):
self.assertEqual("environment_value", CLI.parse(["--env", "environment_value"])[0].environment)
self.assertEqual("environment_value", CLI.parse(["--environment", "environment_value"])[0].environment)
示例3: test_it_should_has_a_default_value_for_paused_mode
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_has_a_default_value_for_paused_mode(self):
self.assertEqual(False, CLI.parse([])[0].paused_mode)
示例4: test_it_should_not_has_a_default_value_for_new_migration
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_not_has_a_default_value_for_new_migration(self):
self.assertEqual(None, CLI.parse([])[0].new_migration)
示例5: test_it_should_not_has_a_default_value_for_schema_version
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_not_has_a_default_value_for_schema_version(self):
self.assertEqual(None, CLI.parse([])[0].schema_version)
示例6: test_it_should_has_a_default_value_for_force_files
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_has_a_default_value_for_force_files(self):
self.assertEqual(False, CLI.parse([])[0].force_use_files_on_down)
示例7: test_it_should_has_a_default_value_for_force_old_migrations
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_has_a_default_value_for_force_old_migrations(self):
self.assertEqual(False, CLI.parse([])[0].force_execute_old_migrations_versions)
示例8: test_it_should_not_has_a_default_value_for_log_dir
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_not_has_a_default_value_for_log_dir(self):
self.assertEqual(None, CLI.parse([])[0].log_dir)
示例9: test_it_should_accept_database_host_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_database_host_options(self):
self.assertEqual("host_value", CLI.parse(["--db-host", "host_value"])[0].database_host)
示例10: test_it_should_accept_database_password_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_database_password_options(self):
self.assertEqual("password_value", CLI.parse(["--db-password", "password_value"])[0].database_password)
示例11: test_it_should_accept_database_user_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_database_user_options(self):
self.assertEqual("user_value", CLI.parse(["--db-user", "user_value"])[0].database_user)
示例12: test_it_should_accept_database_version_table_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_database_version_table_options(self):
self.assertEqual("version_table_value", CLI.parse(["--db-version-table", "version_table_value"])[0].database_version_table)
示例13: test_it_should_accept_database_engine_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_database_engine_options(self):
self.assertEqual("engine_value", CLI.parse(["--db-engine", "engine_value"])[0].database_engine)
示例14: test_it_should_accept_utc_timestamp_options
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_accept_utc_timestamp_options(self):
self.assertEqual(True, CLI.parse(["--utc-timestamp"])[0].utc_timestamp)
示例15: test_it_should_has_a_default_value_for_utc_timestamp
# 需要导入模块: from simple_db_migrate.cli import CLI [as 别名]
# 或者: from simple_db_migrate.cli.CLI import parse [as 别名]
def test_it_should_has_a_default_value_for_utc_timestamp(self):
self.assertEqual(False, CLI.parse([])[0].utc_timestamp)