Exemplo n.º 1
0
 def test_it_uses_config_file_defaults(self):
     self.writeconfig(
         sources="/tmp/migrations",
         database="postgresql:///foo",
         migration_table="my_migrations",
     )
     _, _, args = parse_args(["apply"])
     assert args.database == "postgresql:///foo"
     assert args.sources == ["/tmp/migrations"]
     assert args.migration_table == "my_migrations"
Exemplo n.º 2
0
 def test_global_args_can_appear_after_command(self):
     _, _, args = parse_args(["apply", "X", "Y"])
     assert args.verbosity == 0
     _, _, args = parse_args(["apply", "-v", "X", "Y"])
     assert args.verbosity == 1
Exemplo n.º 3
0
 def test_global_args_can_appear_before_command(self):
     _, _, args = parse_args(["apply", "X", "--database", "Y"])
     assert args.verbosity == 0
     _, _, args = parse_args(["-v", "apply", "X", "--database", "Y"])
     assert args.verbosity == 1
Exemplo n.º 4
0
 def test_cli_args_take_precendence(self):
     self.writeconfig(sources="A")
     _, _, args = parse_args(["apply", "B", "--database", "C"])
     assert args.sources == ["B"]
Exemplo n.º 5
0
 def test_it_uses_interpolated_values_from_config(self):
     self.writeconfig(sources="%(here)s/migrations")
     _, _, args = parse_args(["apply"])
     assert args.sources == [os.getcwd() + "/migrations"]